diff --git a/src/core/Cool-str.pm b/src/core/Cool-str.pm index 8c3674bff5d..ec0cafd1aba 100644 --- a/src/core/Cool-str.pm +++ b/src/core/Cool-str.pm @@ -303,8 +303,13 @@ augment class Cool { } else { if $m.to == $m.from { %opts = $m.to + 1; + if $p.defined { + warn "multiple matches with :p terminated by zero-width match\n"; + last; + } } else { %opts = $m.to; + %opts

= $m.to if $p.defined; } }