procmail
[Top] [All Lists]

Re: Beginner - please help

2007-04-16 05:22:17

On Mon, 16 Apr 2007, Udi Mottelo wrote:


On Sun, 15 Apr 2007, David W. Tamkin wrote:

Udi,

    Some examples to show that  \<  can be substitute for NEWLINE
    but, not all the times:

:0 HB
* aaa(.*\<)?bbb
{ HOST= }

Actually, what you've proved is that . cannot match newline, which we
know.  Here's what you thought was a counterexample:

prompt# echo -e 'aaaQQQ\012PPP\012bbb' | procmail ./proc
...
procmail: No match on "aaa(.*\<)?bbb"

Since your expression allows zero or one matches to (.*\<) but not more
than one, you're requiring either the first newline to match dot, which
it won't, or the P after the first newline to match b, which it doesn't.
 If your regexp were

 aaa(.*\<)*bbb
or
 aaa(.*\<)+bbb

either of which allows for more than one occurrence of .*\< between aaa
and bbb, the text would have matched.

      But look in this example:

prompt# echo -e 'aaaQQQ+PPP+bbb' | procmail ./proc
...
procmail: Match on "aaa(.*\<)?bbb"

      Why match?  The + is  \<

        It match because . takes the first +

Bye,
  Udi


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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