Skip to content
Browse files

[GGE::Perl6Regex] implmented &after

  • Loading branch information...
1 parent 4a955a7 commit 5d9711b348b93ff739a737acd030c8df33266250 @masak committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/GGE/Perl6Regex.pm
View
9 lib/GGE/Perl6Regex.pm
@@ -781,4 +781,13 @@ class GGE::Match is also {
}
return $mob;
}
+
+ method after($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;
+ }
+ return $mob;
+ }
}

0 comments on commit 5d9711b

Please sign in to comment.
Something went wrong with that request. Please try again.