procmail
[Top] [All Lists]

Re: .* question

2003-05-20 03:38:04
On Mon, 19 May 2003 the voices made Stand H write:

SH> Yes, I'm really surprised. It looks like . matches 'a'
SH> then * looks for another 'a' but there is no 'a'
SH> anymore so it matches nothing. Then the result of
SH> match is empty. I tried .*foo, there was no match with
SH> .*foo. Can you explain to me or point me to a link?
SH> Your example seems to be a bit far from my question.
SH> Thank you very much for your reply.

 From the manual (`man procmailrc`):

       .         Any character except a newline.
       a*        Any sequence of zero or more a's.

 Combine the both into .* and you get "any sequence of zero or more of any
characters", ie it doesn't think "hey, this first 'any character' is an a, so
the following 'any character's must also be the an a".

 In a non-greedy situation (ie it'll pick the minimum number of characters to
math) .* ends up being 'a zero length sequence of anything'.

 In procmail any matching left of a \/ (including when there is no \/) will be
non-greedy.

 From the manual regarding \/:

       \/        Splits the expression in two parts.   Everything
                 matching  the right part will be assigned to the
                 MATCH environment variable.


 Did that answer your question?

 If it did I'd like to point out that this was more or less only stuff
available in the manual, and that you easily could have tested it yourself
using a so called sandbox (ie a non-live environment set up just for testing
recipes).

-- 
  .-------------------------------------------------------------------.
  | Per scientiam ad libertatem! (Through knowledge towards freedom!) |
  `-------------------------------------------------------------------´
                   << ©1998-2003 tony(_at_)svanstrom(_dot_)com >>


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


<Prev in Thread] Current Thread [Next in Thread>