On 9/2/07, Chris E. Rempola <[EMAIL PROTECTED]> wrote:
> Chas Owens wrote:
> >
> > The pattern /#.*\s(\S+)/ matches a literal # followed by anything up
> > to a space and captures all contiguous non-space characters:
> >
> > "31 Aug 2007 04:00:22 GMT  " prematch
> > "#" matches #
> > "8810118  337545  <[EMAIL PROTECTED]>" matches .*
> > "  " matches \s
> > "bouncing" matches \S+
> >
> > Even turning on non-greedy matching won't help, it will just cause it
> > to match 337545.  So we need to take a different approach.  Try
> > /#\d+\s+\d+\s+(\S*)/ instead.
>
> Thanks for the explanation Chas.  The regex pattern you provided worked!
>   Thank you..
snip

Please note that this is just a bandaid.  There are undoubtedly other
valid inputs that will break.  What you really need to do is find the
grammar for the file you are parsing.  I expect that it is in the
qmail documentation somewhere.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to