views:

21

answers:

1

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

+2  A: 

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

splash
Thanx @splash works like a charm.
Adnan