This should do
my $regex = qr/ \d (??{ substr($&, -1) + 1 }) + /x; "148012" =~ $regex; print ">$&<" __END__ >012<
The minimal length of the sequence can be set by {x,} instead of the + quantifier. ¹
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
¹) with x = min-1
In reply to Re^3: Regex to match ascending sequence
by LanX
in thread Regex to match ascending sequence
by ExReg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |