in reply to Regex to match ascending sequence

Second statement: assign regex to $c

Inside regex: increment $c

what do you expect from an incremented regex?

Then your regex says greedy match ( any number  or  $c++ ) and number will match any time before trying the or branch.

Actually this might be the reason why incrementing a regex doesn't throw an error, it's never executed.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Regex to match ascending sequence
by ExReg (Priest) on Oct 15, 2015 at 16:46 UTC
    Sadly true. Indication that at this point I am flailing at trying to figure out how to do it.