procmail
[Top] [All Lists]

Re: unexpected regexp handling - looks like a procmail bug

2002-10-25 06:27:02
On 25 Oct, David W. Tamkin wrote:
| Sean is puzzled because
| 
|| * ^Subject:.*\<test(ing)?\>.*(AOL|HTML)
| 
| matches if the subject ends in "test" and "aol" appears on the next line.
| 
|| I don't think I've boffed the regexp - it seems that this is a real bug.
| 
| No, it's no bug.  Read the fluffy procmailrc(5) manual: \< and \> can match a
| newline.  If you want to be positive that the regexp doesn't cross a newline,
| you can't use them.  You need to use something like [^a-z0-9], which cannot
| match a newline.
| 

In this particular case, Sean indicated he was capturing the contents of
the Subject: header to a variable $SUBJECT.  If that variable is tested
instead of rescanning the headers, his regexp should be fine as is.

* SUBJECT ?? ()\<test(ing)?\>.*(AOL|HTML)

I know David and Sean know that, but thought it might be helpful for Don
(procmail(_at_)deliberate(_dot_)net) who followed up, and anyone else who might 
be
looking in with interest.

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.



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