Igor Igor - 2 years ago 123
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.

Answer Source
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download