|Pathologically Eclectic Rubbish Lister|
IPv4 regexby ryan (Pilgrim)
|on Feb 18, 2001 at 17:05 UTC||Need Help??|
ryan has asked for the
wisdom of the Perl Monks concerning the following question:
Hi, I've needed to validate user input to ensure it is a validly formatted IPv4 address.
The one I came up with before I looked around was:
Is there anything failsafe yet more efficient than this?
After hunting around I discovered suprisingly that many mail programs and even the LRP favour using this regex:
As a side note, I'm sure there is a way to compare two variables to the same regex in one neat expression rather than