regex - notepad++ replace text with get some text -
hello want replace text :
test.myfonction(arg1, arg2) test2.myfonction(arg1, arg2) test3.myfonction(arg1, arg2) by this:
myfonction2(test, arg1, arg2) myfonction2(test2, arg1, arg2) myfonction2(test3, arg1, arg2) for this, use regex in notepad++, find something.mafonction(arg1, arg2) use this:
(*).myfonction( but how test, test or test3 ?
myfonction2(test
well, need capture string before ., function name , parameters:
(\w+)\.(\w+)\(([^\)]+)\) now have 3 groups:
- the first string
- the function name
- the arguments
and can use replace string desired output:
\2\(\1, \3\)
Comments
Post a Comment