I use this regex to match (but not capture) nested parens. It's from the Camel, 3rd. ed., p. 314.
my $np; $np = qr{ \( (?: (?> [^()]+ ) | (??{ $np }) )* \) }x;
In reply to Re: search for matching parentheses
by smammy
in thread search for matching parentheses
by embirath
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |