Subject: | No support for constructs added in Perl version 5.10 and later |
Regexp::Parser does not support Perl regular expression constructs
introduced in Perl version 5.10.0. Refer to the following URL:
http://perldoc.perl.org/perl5100delta.html#Regular-expressions
For example, the \K escape incorrectly parses as a Regexp::Parser::exact
object. I have tried this on perl version 5.12.2; see the attached
code and output produced.
This limitation also exists in Regexp::Parser's predecessor module
(YAPE::Regex). Although the Regexp::Parser POD alludes to Perl version
5.8.4, I think it would be useful to explicitly add some documentation
to the POD mentioning the lack of support for 5.10 (and later) versions
of Perl.
Every time Perl changes its regular expression behavior, this module
must also be changed, and the POD should denote the supported version
of Perl.
Subject: | parse.pl |
use warnings;
use strict;
use Regexp::Parser;
use Data::Dumper;
print "Perl version: $]\n";
my $p = Regexp::Parser->new(qr/\K/);
$p->parse;
print Dumper($p);
__END__
Unrecognized escape \K passed through; marked by <-- HERE in m/(?-xism:\K <-- HERE )/ at parse.pl line 7
Perl version: 5.012002
$VAR1 = bless( {
'len' => 11,
'next' => [],
'flags' => [
0
],
'tree' => [
bless( {
'flags' => 0,
'rx' => $VAR1,
'zerolen' => '',
'off' => 'xism',
'data' => [
bless( {
'flags' => 0,
'rx' => $VAR1,
'data' => [
'K'
],
'vis' => [
'K'
],
'family' => 'exact'
}, 'Regexp::Parser::exact' )
],
'on' => '',
'type' => 'group',
'down' => 1,
'family' => 'group'
}, 'Regexp::Parser::group' )
],
'nparen' => 0,
'maxpar' => 0,
'regex' => \'(?-xism:\\K)',
'captures' => []
}, 'Regexp::Parser' );