Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Don't Use Regular Expressions To Parse IP Addresses!

by Anonymous Monk
on Nov 08, 2007 at 00:07 UTC ( [id://649598]=note: print w/replies, xml ) Need Help??


in reply to Re: Don't Use Regular Expressions To Parse IP Addresses!
in thread Don't Use Regular Expressions To Parse IP Addresses!

Not really - the above regex is wrong. Try it on 10.76.110.219 and it will match only 10.76.110.21 (since 1?\d\d? will match 21 and stop and not look for the 2[0-4]\d rule)
  • Comment on Re^2: Don't Use Regular Expressions To Parse IP Addresses!

Replies are listed 'Best First'.
Re^3: Don't Use Regular Expressions To Parse IP Addresses!
by Anonymous Monk on May 26, 2009 at 18:25 UTC
    It works inside the correct context. For example, if you supply a leading ^ and trailing $ then all is well. You have to supply your own context.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://649598]
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-06-20 05:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.