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+)\(([^\)]+)\) 

demo.

now have 3 groups:

  1. the first string
  2. the function name
  3. the arguments

and can use replace string desired output:

\2\(\1, \3\) 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -