Igor Igor - 7 months ago 42
Perl Question

Creating a regex to find an ip address (not including 192.168)

i'm using perl and i want to create a regex to find an IP address, (but not 192.168 and not a domain)

I trying to use this:

if($record =~ /^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(?:(?<!192\.168)[\S\s])*$/ )
{print "$record $1";}

But it doesn't work as i expected.