procmail
[Top] [All Lists]

Re: .* question

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

Stand
--- Professional Software Engineering
<PSE-L(_at_)mail(_dot_)professional(_dot_)org> wrote:
At 01:31 2003-05-19 -0700, Stand H wrote:
I'm new to regex(in general) and procmail.
I have questions regarding .*

There's an excellent regexp book published by
O'Reilly and Associates 
(ORA), titled _Mastering_Regular_Expressions_

If I have a pattern 'abcdef' and a regex .* without
single quote.

If you write a simple recipe and use match:

#-----
# testfile.rc
STRING="abcdef"

:0
* STRING ?? ()\/.*
{
         LOG="We matched on [$MATCH]
"
}

:0
* ^Subject:\/.*
{
         LOG="We matched subject on [$MATCH]
"
}

#-----

then invoke it:

cat somemessage.txt | procmail -m testrcfile.rc

You might be surprised at what you find.  Consider
that _NOTHINGNESS_ 
satisfies that regexp, and thus, nothing is
necessary to match it.  If you 
have:  ".*foo", then the string which is matched is
different.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer:

<http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get
my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE

http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail



__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.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>