use strict; use warnings; use Text::Balanced qw(extract_bracketed); my $text = '(aaa) (bbb (ccc( ddd) eee) (fff)' ; my @tokens = extract_bracketed($text, '()'); print "$_\n" for @tokens; # Output: #(aaa) # (bbb (ccc( ddd) eee) (fff)
In reply to Re: regex to parse (nested) parenthesis delimited string?
by imp
in thread regex to parse (nested) parenthesis delimited string?
by varian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |