in reply to Re^2: Check a string for consecutive digits
in thread Check a string for consecutive digits
Your more neat (IMHO) variant is easily made configurable and, like Re: Check a string for consecutive digits, uses no 5.10 regex extensions:
use constant MIN => 4; my $delta = MIN-1; ;; my ($too_many_consec) = map qr{ $_ }xms, join ' | ', map { $_, scalar reverse $_ } map { join '', $_ .. $_+$delta } 0 .. (9-$delta) ; ...
Give a man a fish: <%-{-{-{-<
|
|---|