in reply to Re: RE greediness
in thread RE greediness

(?:...) is a non-capturing group, positive lookahead uses (?=...) which I can't find in the regex used.

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

Replies are listed 'Best First'.
Re^3: RE greediness
by Anonymous Monk on May 29, 2024 at 20:46 UTC
      (?:...) is a non-capturing group, positive lookahead uses (?=...) which I can't find in the regex used.
    Sorry for the typo, meant to type this, but it's still wrong:
    /(a)(?=(.*?)(?:b=(\w)))?/
    This seems to work:
    /(a)(.*?)(?=b=(\w)|\z)/