What moritz said. This would be a start, which you might need to tweak based on any unmentioned requirements:
use Regexp::Common qw(net); while (<>) { my ($keeper) = $_ =~ / ($RE{net}{IPv4}) # Capture the IP , # comma /x; printf "%s\n", $keeper if $keeper; }
In reply to Re: Regex to take an ip address before a comma
by oeuftete
in thread Regex to take an ip address before a comma
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |