Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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

by sieve (Initiate)
on May 18, 2007 at 20:25 UTC ( #616269=note: print w/replies, xml ) Need Help??

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

If you do use a regular expressions to parse IPv4 in decimal, you could use:

Replies are listed 'Best First'.
Re^2: Don't Use Regular Expressions To Parse IP Addresses!
by Anonymous Monk on Nov 08, 2007 at 00:07 UTC
    Not really - the above regex is wrong. Try it on and it will match only (since 1?\d\d? will match 21 and stop and not look for the 2[0-4]\d rule)
      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://616269]
[Eily]: you could have tried randomly swapping your fingers
[Eily]: enigma style
[choroba]: so it was you who typed the whole phrases?
[Yaerox]: I feel like i'm not seeing the forest for the trees. Can someone give me a hint how to research converting all kinds of files into ansi? If origin file is utf8 convert to ansi, is origin file is ansi then skip file.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2017-03-28 13:09 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (331 votes). Check out past polls.