in reply to Re^2: Process mail logs
in thread Process mail logs
If you plan on using Perl for more than a day or two I strongly recommend you read through the regular expression documentation provided with Perl (see perlretut, perlre and perlreref). Perl is strong on text processing and a large chunk of that comes from using regular expressions so understanding Perl's regular expression is important to writing good Perl code.
For this particular match you could make it more or less fussy (like mathing the () part or not). A somewhat non-fussy match would be /H=[^[]* \[ ([^\]]+) \]/x. Note the use of the x flag to allow white space in the expression so it's easier to see the various moving parts.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Process mail logs
by stevbutt (Novice) on Aug 13, 2012 at 23:56 UTC |