in reply to Extracting IP address from large text file.
IS THE BELOW CORRECT?my $str = 'BIG BIG DATA FILE'; 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}; }
It will extract all occurrences of what you define as an 'ip address' to the array.
BTW again: It is better to reply to a post immediately after (and 'below') the post rather than as an addendum to the OP: makes the conversation a lot easier to follow.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extracting IP address from large text file.
by AnomalousMonk (Archbishop) on Oct 19, 2010 at 22:58 UTC | |
by Monkomatic (Sexton) on Oct 19, 2010 at 23:26 UTC | |
by AnomalousMonk (Archbishop) on Oct 20, 2010 at 12:01 UTC | |
|
Re^2: Extracting IP address from large text file.
by Monkomatic (Sexton) on Oct 19, 2010 at 23:06 UTC | |
by AnomalousMonk (Archbishop) on Oct 19, 2010 at 23:16 UTC |