procmail
[Top] [All Lists]

Re: matching multiple lines

2002-04-12 09:25:04
On 11 Apr, David W. Tamkin wrote:
| Rejo Zenger asked,
| 
|| Is there an easy way to match on multiple lines, regardless where in the
|| regexp the new line starts? I have regexps like these:
||
||   * 1^1   we (always )?(respect|honor) (all )?remov(al|e) requests
||
|| However, if in the spam this is split into two lines, this regexp will
|| not match it. Any ideas?
| 
| Rik Kabel had one: use  (\<)+  instead of a space.  (\>)+  works as well.  \<
| and \> can match newlines.
| 

I use these extensively in body matches but have never enclosed them in
parentheses unless they were part of an alternation. I've never noticed
any ill effects though I'm not sure I would.  A quick test indicates the
parentheses are not needed to "protect" the \> or \< tokens when
followed by a + modifier. Is that correct, and are the parentheses
syntactic sugar, or have I missed something?

-- 
Reply to list please, or append "6" 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