How can I exclude a string from the match in regex?
Input:
functionXY("Hello World");
Match:
functionXY();
i got this far with my regex expression:
/functionXY[(][)][;]/gm
but can't find the correct expression to exclude the string "Hello World" in the match.
Your pattern functionXY[(][)][;] uses square brackets for single characters and only matches functionXY();
Instead you can use 2 capture groups to capture what you want to keep, and match the double quotes and all chars other than double quotes that you don't want to keep.
In the replacement use 2 capture groups $1$2
(functionXY\()"[^"]*"(\);)