Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Match Ip Address on cmd lineby NetWallah (Canon) |
on Sep 09, 2011 at 05:13 UTC ( [id://925011]=note: print w/replies, xml ) | Need Help?? |
This 'quick and dirty' regex will work reasonably well for "reasonable" data:
It is tolerant of leading and trailing white-space, but does not check for octets being under 255, or being all zero at the first octet. There are "standard regex" Regexp::Common modules that do a more thorough check for IPv4 validity. "XML is like violence: if it doesn't solve your problem, use more."
In Section
Seekers of Perl Wisdom
|
|