Skip to content

Commit

Permalink
fix interaction between :g and :p regex modifiers in Cool.match
Browse files Browse the repository at this point in the history
At least there are some tests that expect them to work together this way,
similar to m/\G$regex/g in p5
  • Loading branch information
moritz committed Aug 12, 2010
1 parent 69561ef commit 9d7428f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Cool-str.pm
Expand Up @@ -303,8 +303,13 @@ augment class Cool {
} else {
if $m.to == $m.from {
%opts<c> = $m.to + 1;
if $p.defined {
warn "multiple matches with :p terminated by zero-width match\n";
last;
}
} else {
%opts<c> = $m.to;
%opts<p> = $m.to if $p.defined;
}
}

Expand Down

0 comments on commit 9d7428f

Please sign in to comment.