2

I have the following possible lines in my code

addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChangeHandler)
addEventListener("click", propertyChangeHandler)
addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, _propertyChangeHandler)
addEventListener(PROPERTY_CHANGE, _propertyChangeHandler)

They all have in common that they start with addEventListener( have one , in the middle and end with a )

What would be the proper regex to cover all cases and add ,false,0,true before the closing parenthesis )

So it would look like:

addEventListener(PROPERTY_CHANGE, _propertyChangeHandler ,false,0,true )

Thank you for your time

0

1 Answer 1

3

A matching regex would be: (addEventListener\([^,]+,[^)]+)\). The corresponding replace expression is $1,false,0,true).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.