in reply to Regex to match ascending sequence

perl -le '"2345654321" =~ /(0?1?2?3?4?5?6?7?8?9?)/ and print $1'

snicker :)

Replies are listed 'Best First'.
Re^2: Regex to match ascending sequence
by ExReg (Priest) on Oct 15, 2015 at 16:57 UTC
    That works for what I stated, but not for what I _meant_. It would match 1357, but I would want it to match 1234567. Also, I am looking for a dynamic regex to do this. The whole reason for all this is that I am trying to get a grasp on dynamic regexes (??{}) and thought this would be an easy start.