I want a quick and easy way to check if a value looks like an IP address, i'm happy just to check if the variable holds 4 numbers separated by dots.
So far I have got
if ($Route=~m/\d\.\d\.\d\.\d/) { do something interesting with the IP address }
Any better way of doing this?
Cheers,Tom
20040808 Edit by castaway: Changed title from 'Perl regexp trickery'
In reply to Regexp to match IP address by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |