Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Seeker of Regex Wisdom (strings which don't form specific patterns)

by AnomalousMonk (Archbishop)
on Aug 13, 2015 at 09:01 UTC ( [id://1138397]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Seeker of Regex Wisdom (strings which don't form specific patterns)
in thread Seeker of Regex Wisdom (strings which don't form specific patterns)

As selective, less verbose, non-repetitive, more readable, better IMHO:

    my $octet_dec = qr{ [01]?\d\d? | 2[0-4]\d | 25[0-5] }xms;

    my $ipv4_dec = qr{ $octet_dec (?: [.] $octet_dec){3} }xms;

Update: Or better yet, as already mentioned, Regexp::Common::net.


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://1138397]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-19 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found