I created a Regex which allows to capture the parameters of a function.
The parameters are separated by the character ,
You can have the character , inside a parameter like 'lorem, impum'
The regex returns only the last match.
My Regex :
\s*(\'.+\'|\".+\"|[^,]+)?(?:\s*,?\s*(\'.+\'|\".+\"|[^,]+))*
function parametes
111111111111,'222222222',"33333333333333"
LInk to regex exemple : https://regex101.com/r/fdRJ92/2
'I, don\'t like to be simple, you understand?'"\"\\")? What about numbers with decimals (11.11)? What about variables (foo)? Variables with property accessors (foo.bar, baz["bat"])? Functions11, foo("22"), 33? With enough complexity, you simply won't be able to achieve the desired result with regexes alone. You'll need a proper parser (like PegJS). You also haven't mentioned which language/API you are using (though I assume JS from the'/")