Simple find/replace using regex in Eclipse
I have the following possible lines in my cod开发者_运维技巧e
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
A matching regex would be: (addEventListener\([^,]+,[^)]+)\)
. The corresponding replace expression is $1,false,0,true)
.
精彩评论