use Regexp::Common 'RE_ALL'; my $string='The use of parentheses (indicates that the (writer [considered] the {information}) less an afterthought).'; $string =~ RE_balanced(-parens=>'(){}[]<>'} and print "$1\n";