Permalink
Browse files

[GGE::Perl6Regex] the after pattern must be anchored

  • Loading branch information...
1 parent 5d9711b commit d422c6d8b4b64afde6ed366b484e4a935069b41e @masak committed Feb 20, 2010
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/GGE/Perl6Regex.pm
  2. +1 −0 t/perl6regex/rx_lookarounds
View
@@ -783,7 +783,7 @@ class GGE::Match is also {
}
method after($pattern) {
- my $rule = GGE::Perl6Regex.new($pattern ~ '$');
+ my $rule = GGE::Perl6Regex.new('[' ~ $pattern ~ ']$');
my $mob = $rule(self.target.substr(0, self.to));
if $mob { # 'after' matches are always zero-width
$mob.from = $mob.to = self.to;
@@ -19,6 +19,7 @@ $ <after ^a> a y lookbehind <after>
<[a..z]>+ az y metasyntax with leading + (<+...>)
<+[a..z]>+ az y metasyntax with leading + (<+...>)
<+alpha>+ az y metasyntax with leading + (<+...>)
+<after a|d> c abc n the after pattern must be grouped
<?> '' y null pattern (<?>)
^ <?> \t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij y null pattern (<?>)

0 comments on commit d422c6d

Please sign in to comment.