I have the followign Regex:
/(?<=SOMEMETHOD\(|\G)\s*((['"]).+?(?<!\\)\2|\{[^}]+\}|[^,;'"(){}\)]+)\s*(?:,|\))/g
I tested it on IRC #Regex, and it works.
!regex (function() { new SOMEMETHOD('Parameter 1','parameter2',{"json1":0,"json2":14962,"json3":false,"json4":'hej'},lastparameter); morecode(); ests sts st /(?<=SOMEMETHOD(|\G)\s*((['"]).+?(?
[Result: 4] [0:-?: ] [1:90-102: 'Parameter 1'] [2:90-90: '] [3:104-115: 'parameter2'] [4:104-104: '] [5:117-169: {"json1":0,"json2":14962,"json3":false,"json4":'hej'}] [6:171-183: lastparameter]
It dont work in .net though:
string pattern = @"/(?<=SOMEMETHOD\(|\G)\s*((['""]).+?(?<!\\)\2|\{[^}]+\}|[^,;'""(){}\)]+)\s*(?:,|\))/g";
var t = Regex.Match(e.Document, pattern);
I dont know if its an escaping problem of some chars.