c:\@Work\Perl\monks>perl -wMstrict -le
"use Regexp::Common qw(balanced);
print $Regexp::Common::balanced::VERSION;
"
2010010201
Are you sure about that code? I can only generate the given output when I add the -keep switch to the RE_balanced() call.
Without -keep:
c:\@Work\Perl\monks>perl -wMstrict -le
"use strict; use warnings; use 5.010;
use Regexp::Common 'RE_balanced';
my $string = 'The use of parentheses (indicates that the ' .
'(writer [considered] the {information}) less ' .
'<importantalmost> an afterthought).';
my $match = RE_balanced( -parens => '(){}[]<>' );
$string =~ s/${match}.*//;
$1 and say \"^>$_^<\" for $string, $1;
"
With -keep:
c:\@Work\Perl\monks>perl -wMstrict -le
"use strict; use warnings; use 5.010;
use Regexp::Common 'RE_balanced';
my $string = 'The use of parentheses (indicates that the ' .
'(writer [considered] the {information}) less ' .
'<importantalmost> an afterthought).';
my $match = RE_balanced( -parens => '(){}[]<>', -keep );
$string =~ s/${match}.*//;
$1 and say \"^>$_^<\" for $string, $1;
"
>The use of parentheses <
>(indicates that the (writer [considered] the {information}) less <imp
+ortantalmost> an afterthought)<
Give a man a fish: <%-{-{-{-<
|