develooper Front page | perl.perl6.users | Postings from August 2019

Lookbehind assertion weirdness

Thread Next
From:
Sean McAfee
Date:
August 22, 2019 19:26
Subject:
Lookbehind assertion weirdness
Message ID:
CANan03Zj4bhdO2Jbu8LuK4+aTQfbnJJGQM5P5UBodqpU+Y+u4w@mail.gmail.com
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.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About