in reply to Regexp to match IP address

Hi!

I found this in the Cookbook:
m/^([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])\. ([01]?\d\d|2[0-4]\d|25[0-5])\.([01]?\d\d|2[0-4]\d|25[0-5])$/;
mawe

Replies are listed 'Best First'.
Re^2: Regexp to match IP address
by Anonymous Monk on Aug 06, 2004 at 14:35 UTC
    blimey, yeah that'll do it thanks!
Re^2: Regexp to match IP address
by codecookers (Initiate) on Mar 16, 2010 at 12:29 UTC
    print"\n ip address " if ($s=~/((\d){1,3}\.){3}(\d){1,3}/) ;