Perl 6 is doing the right thing. The dot matches any character. In
this case, matching the final ':'. The next bit of the regex says the
cursor has to be after 1:, and indeed, after matching the ':' the
cursor is after '1:', so the substitution succeeds.

Maybe you want s/<?after '1:'>/x/ to append 'x' after '1:' ?
Or s/<?after '1:'>./x/ to replace whatever is after '1:' with 'x' ?

-y

On Fri, Aug 23, 2019 at 3:26 AM Sean McAfee <eef...@gmail.com> wrote:
>
> This seems like a bug, but I thought I'd ask here before reporting it.
>
>     $_ = '1:';
>     s/.<?after '1:'>/x/;
>     .say;
>
> This prints "1x".  Is that what's supposed to happen somehow?  I would have 
> thought that '1:' should only match a literal "1:", leaving nothing for the 
> dot to match.
>

Reply via email to