in reply to Extracting IP address from large text file.

Have a look at the various items available under Regexp::Common on CPAN . . .

  • Comment on Re: Extracting IP address from large text file.

Replies are listed 'Best First'.
Re^2: Extracting IP address from large text file.
by Monkomatic (Sexton) on Oct 21, 2010 at 13:27 UTC
    my $str = 'br>94.198.240.132:60988 asdfasdf 174.142.24.201:3128 asdfas +dfasdf'; if (my @matches = $str =~ m{ ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9 +]{1,3}:[0-9]{1,5}) }xmsg) { print qq{matched @matches}; }

    Finally got this it work... It was bugging me :)

    Thanks everyone for the help. sorry for my stupidity missing the embedded code.