in reply to Validating IP Address
This is a variation of one from the Book "Mastering Regular Expressions" by Jeffrey Friedl,
which I highly recommend.
Wonko
Best Regards,unless ( $ip =~ m/^(?:[1]?\d\d?|2[0-4]\d|25[0-5])\. (?:[1]?\d\d?|2[0-4]\d|25[0-5])\. (?:[1]?\d\d?|2[0-4]\d|25[0-5])\. (?:[1]?\d\d?|2[0-4]\d|25[0-5])$ /x ) { # do something }
Wonko
|
---|
In Section
Seekers of Perl Wisdom