http://www.perlmonks.org?node_id=11128166


in reply to Re^3: regex gotcha moving from 5.8.8 to 5.30.0?
in thread regex gotcha moving from 5.8.8 to 5.30.0?

... \G having to refer back to the last match.

IIUC, the \G anchor refers to the pos of the string against which the match is being attempted (the pos from a previous, unsuccessful match attempt having been preserved by the /c modifier), and so should should be pretty cheap/quick. Is your experience otherwise?


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^5: regex gotcha moving from 5.8.8 to 5.30.0?
by kschwab (Vicar) on Feb 10, 2021 at 05:43 UTC
    No, but it's a regression, and seems to be narrowed down somewhere in:
    $text =~ /\G \s* ^ \s* begfoo \s+ (\S+?) \s* \( \s* (.*?) \s +* \) \s* ;/gcmsx
    And it sounds like replacing .*? with [^;]*? was tried.