I have a string with a nested pattern func(func(doSomething)) and I have a Regex expression: /func\(([^ ]*)\)/gm. I want to get two separate matches where:
Match 1:
match: func(func(doSomething))
group captured:func(doSomething)
Match 2:
match: func(doSomething)
group captured:doSomething
However, I'm only getting a single match with the entire inner 'func' being a capturing group.
Here is the regex link: https://regex101.com/r/dUa4SC/1
Is it possible to achieve this using regex? if so Please help me with it.
Thanks