$re = qr{ \( (?{ local $N = 1 }) (?: (?(?{ !$N })(?!)) (?: \( (?{ local $N = $N + 1 }) | \) (?{ local $N = $N - 1 }) | [^()]+ ) )+ (?(?{ $N })(?!)) # fixed, thanks to Hofmator }x; $text =~ s/$re//g;
In reply to Re: Regex To remove text between parentheses
by japhy
in thread Regex To remove text between parentheses
by beretboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |