in reply to Re^2: Why doesn't this regex work? ( lookaround backtracking pos)
in thread Why doesn't this regex work? (Solved!)

Took me a few dozen looks, I started to compose some funny(wrong) answers some 3-4 times

The experimental (??{ code }) feature looks kinda neat

perl -le " $_ = shift; s{(\d+)\d\s\K(?=(??{$1+1})\d\s)}{\n}g; print " +"11 12 21 22 32 33 41 44" 11 12 21 22 32 33 41 44
  • Comment on Re^3: Why doesn't this regex work? ( lookaround dynamic postponed pattern (??{ code })
  • Download Code

Replies are listed 'Best First'.
Re^4: Why doesn't this regex work? ( lookaround dynamic postponed pattern (??{ code })
by BrowserUk (Patriarch) on Aug 15, 2013 at 12:44 UTC
    Took me a few dozen looks, I started to compose some funny(wrong) answers some 3-4 times

    Makes me feel a little better that I'm not the only one had trouble seeing it :)

    The experimental (??{ code }) feature looks kinda neat

    Indeed. Trouble is I can never remember whether it is the (?{}) or (??{}) that interpolates; and rather than go look it up, I opt for an alternative if one springs to mind.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.