in reply to RegEx & Approach Question
in your regex $2 is
You need to escape the parenthesis. try the code after escaping ((size/max/drops/flushes).
Note: Since ( I think ) I found some mismatch in No. of spaces from your sample text with the regex, I replaced all spaces with \s+ in the regx.if ($line =~ m/\s+Input\s+queue:\s+0\/75\/(.*)\/39\s+\(size\/max\/drop +s\/flushes\); \s+Total\s+output drops:\s+(.*)/) { printf("%-20.20s %-22.22s : $line\n",$file,$currentInterface) if ($1 | +| $2 != 0); }
--VC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RegEx & Approach Question
by ikegami (Patriarch) on Oct 09, 2007 at 14:16 UTC |