monger has asked for the wisdom of the Perl Monks concerning the following question:
Here is the return. And I apologize, the last two quads are necessarily obfuscated.$regex = '\w159\.230\.([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4 +]\d|25[0-4])'; while (<INFILE>) { if (m/$regex/os) { print PIXOUT $_;
What I want to have in the output file is simply 159.230.xxx.xxx. I have tried several different things, including \w before the regex and $/ afterwards. Those produce no results. The regex as you see it now is what works. This is all being done on a RedHat Linux 7.2 box with Perl 5.6.0. Thanks, Mongernetwork-object 159.230.xxx.xxx 255.255.224.0 network-object 159.230.xxx.xxx 255.255.252.0 network-object 159.230.xxx.xxx 255.255.255.0 network-object host 159.230.xxx.xxx network-object host 159.230.xxx.xxx network-object host 159.230.xxx.xxx
update (broquaint): added <code> to the sample output
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Match only certain IP Addresses
by fs (Monk) on Aug 06, 2003 at 21:07 UTC | |
by zengargoyle (Deacon) on Aug 06, 2003 at 22:02 UTC | |
by bobn (Chaplain) on Aug 07, 2003 at 06:41 UTC | |
|
Re: Match only certain IP Addresses
by Mr. Muskrat (Canon) on Aug 06, 2003 at 21:15 UTC | |
|
Re: Match only certain IP Addresses
by sgifford (Prior) on Aug 06, 2003 at 21:03 UTC | |
|
Re: Match only certain IP Addresses
by phydeauxarff (Priest) on Aug 07, 2003 at 01:03 UTC | |
by DrHyde (Prior) on Aug 07, 2003 at 08:19 UTC | |
by zengargoyle (Deacon) on Aug 07, 2003 at 01:28 UTC | |
|
Re: Match only certain IP Addresses
by monktim (Friar) on Aug 06, 2003 at 21:14 UTC |