Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Check a string for consecutive digits

by AnomalousMonk (Archbishop)
on Nov 26, 2015 at 18:48 UTC ( [id://1148677]=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found