I have a snippet of code that looks like this:
foreach $line (@connections) {
if ($line =~ /^\s*(\d+\.\d+\.\d+\.\d+):\d+
\s*->\s*(\d+\.\d+\.\d+\.\d+):\d+
\s*->\s*(\d+\.\d+\.\d+\.\d+)/x) {
$client_ip{$1}{$iteration}++;
$vips{$2}{$iteration}++;
$frontend{$3}{$iteration}++;
}
}
(This collects information on a F5 BigIP loadbalancer, for those of you who are curious).
Is there a better way I can do the
(\d+\.\d+\.\d+\.\d+)? As you can tell, I'm just trying to match for a numeric IP address.
<-> In general, we find that those who disparage a given operating system, language, or philosophy have never had to use it in pratice. <->
update (broquaint): title change (was Regex redux)