in reply to Log Parsing using Regex
The above PERL works with the exception that each value in my output contains the "^A".
The language is called "Perl", the interpreter is called "perl". PERL does not exists.
Anyway, if you don't want to capture the ^A, don't put it inside the parenthesis:
if ($line =~ m/\x01 55= (.*?) \x01/x) { ... }
You can get rid of the non-greedy quantifier by using a char class instead:
if ($line =~ m/\x01 55= ([^\x01]*) /x) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Log Parsing using Regex
by Anonymous Monk on Jul 09, 2009 at 13:25 UTC | |
by AnomalousMonk (Archbishop) on Jul 09, 2009 at 15:33 UTC |