![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Are you sure you want to allow 0 as the first character?
Or three 0's as the first octet? IP addresses don't really
lend themselves to regular expressions. If you really want
to check for correctness i'd do something like this:
Okay, okay, it ain't briefer, but it will probably enforce something more like an actual IP address. Then again, if you are just trying to pick out IP addresses in text, you might be alright with your regex... You won't find strings like '304.00.3.999' very often in text files.
Hope this helps, In reply to RE: Matching an IP address
by young perlhopper
|
|