in reply to Masking IPs
if (/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/){ s/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/xxx.xxx.xxx.xxx/g; print VPNOUTFILE "$_"; }
The original and the above are redundant, though. You could simply use:
if (s/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/xxx.xxx.xxx.xxx/g) { print VPNOUTFILE "$_"; }
Are you sure you need to specify \d{1,3}? The following is somewhat easier to read:
if (s/\d+\.\d+\.\d+\.\d+/xxx.xxx.xxx.xxx/g) { print VPNOUTFILE "$_"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Masking IPs
by kaif (Friar) on Jun 29, 2005 at 00:09 UTC |