I have around 200 function calls of the form
markers.add(packageDecl.getPosition(), "package.invalid", this.fullName);
which need to be replaced with
markers.add(I18n.createMarker(packageDecl.getPosition(), "package.invalid", this.fullName));
^^^^^^^^^^^^^^^^^^ ^
They can have an arbitrary number of function arguments and the arguments can be nested calls, as seen in the example. However, it is given that the ; is always succeeded by a newline.
I already tried this regex:
markers\.add\((.*)$
Which allows me to strip the markers.add( part and add the I18n.createMarker(. However, I cannot add the extra closing parenthesis at the end: ); -> ));.