you may be interested in Regexp::Common too to cover edge cases:
perl -MRegexp::Common=net -E "say +(/$RE{net}{IPv4}/?'IP ':'NOT ip '). +$_ for @ARGV" 10.10.10.1 888.888.888.888 8.8.8.8 0.0.0.0 IP 10.10.10.1 NOT ip 888.888.888.888 IP 8.8.8.8 IP 0.0.0.0
L*
PS: my congratulations for your signature!
In reply to Re: Extract IP addresses
by Discipulus
in thread Extract IP addresses
by reisinge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |