in reply to Re^2: How to capture backwards using regex?
in thread How to capture backwards using regex?

> Are you implying that 5.38 is needed for my code?

No, sorry, I misread what you wrote:

> Unfortunately with variable length this still seems experimental with 5.38 ...

In fact, 5.30 is enough to run it, see perlre:

Prior to Perl 5.30, it worked only for fixed-width lookbehind, but starting in that release, it can handle variable lengths from 1 to 255 characters as an experimental feature.

The (*pla:pattern) syntax is from 5.28, in earlier versions, the only possible syntax was (?<=).

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: How to capture backwards using regex?
by LanX (Saint) on Nov 11, 2024 at 21:51 UTC
    > (*pla:pattern) syntax is from 5.28

    Yes I was aware about this being "new", but honestly I really have problems remembering the old syntax.

    > Prior to Perl 5.30, it worked only for fixed-width lookbehind

    I think a more interesting task would be to show applications of *plb or *nlb which can't be emulated with \G

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery