I would rather use:
$i++ while $pars =~ s/\(([^()]*)\)/$1/;Better way is to use Regexp::Common and balanced pattern (not tested):
use Regexp::Common; $pars =~ /^[^()]*$RE{balanced}{-parens=>'()'}[^()]*$/
In reply to Re^3: AND and OR on Regular Expressions
by grizzley
in thread AND and OR on Regular Expressions
by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |