On 8/11/05, Alex <[EMAIL PROTECTED]> wrote: > > Also, correction posted by Jay, is not applicabile because we have more > > lines containing "Virus" word and only one should be counted (***** Virus). > > > > Alex > > And for posterity, i am answering myself: > > elsif($prog eq 'hook') { > # Vexira antivirus > if($text =~ /^[\*]+ Virus\b/) { > event($time, 'virus'); > } > } > > Alex >
Close. That will also pick up \*\*\*\*\*\*\*\ Virus, \\\\\\\\\\\\\\\\ Virus, etc. /[\*]+/ captures one or more '\' and/or '*', because metacharacters lose their meanings inside [], except an initial '^', which gets a completely different meaning. you want: /^[*]+ Virus\b/ or /^\*+ Virus\b/ If the number of asterisks is going to be constant, you can be completely sure with: /^\*{5} Virus\b/ HTH, -- jay -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.dpguru.com http://www.engatiki.org values of β will give rise to dom!