I am trying to find a regex that matches brakets that may contain other brakets.
Example:
Match1(Match2())
I want the output to be:
Match1:
$0 => 'Match1(Match2())'
$1 => 'Match1'
$2 => 'Match2()'
Match2:
$0 => 'Match2()'
$1 => 'Match2'
$2 => ''
Is there a way to get it done, e.g. \w+\(.*?\)