Extracting Arguments from Function Calls with Regular Expression
Problem Formulation I have to extract arguments from function calls with NodeJS. For example: `foo0()` => [“”] `foo1(1)` => [“1”] `foo2(1, “HelloThere”)` => [“1”, “”HelloThere””] `foo3(foo1(1), foo2(foo1(1), 2), 3)` => [“foo(1)”, “foo2(foo1(1), 2)”, 3] `foo4( // 123456 foo1(1), abcdef, foo2(1, 2) + foo3(1+2, 333, “Hello”), “nRandom,((,,,Dummy )),, ,, ,Stringn” )` => [“// 123456n foo1(1)”, “abcdef”, […]