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.
In reply to Re^3: Process mail logs
by GrandFather
in thread Process mail logs
by stevbutt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |