Function Replace myfunc(abc, 5, xyz) -----> myfunc(abc, xyz, 5 , xyz) using RegEx

9 views
Skip to first unread message

Explorer

unread,
May 27, 2014, 4:26:10 PM5/27/14
to re...@googlegroups.com
Hi All, 

I am new to regular expressions , and trying to find a way to do a replace on function like below

myfunc(abc, 5, xyz)
myfunc(abc, xyz, 5 , xyz)

Tried a number of ways but not able to get it, i think \(([^\,]+)\ to get the content before comma should is ok, but not working unfortunately

\(myfunc((\)\(([^\,]+)\,\([^\,]+)\,\([^\,]+) 

\1,\3,\2,\3

Would be great if someone could point me in the right direction

iiz

unread,
Jun 27, 2014, 8:14:55 AM6/27/14
to re...@googlegroups.com
Search for
(?=\()([^)]*),([^)]*),([^)]*)(?=\))

replace with
\1,\3,\2,\3

Op dinsdag 27 mei 2014 22:26:10 UTC+2 schreef Explorer:
Reply all
Reply to author
Forward
0 new messages