[H-GEN] Emacs Lisp and Regular Expressions

Clinton Roy croy at dstc.edu.au
Tue Nov 26 07:33:13 EST 2002


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

john duncan <agley at austarmetro.com.au> writes:

>           I have been using Gnus for mail and news with a sorting rule
> like the one following,
>
> (setq nnmail-split-methods
>       '(("humbug" "To:.*general at lists.humbug.org.au")
>         ("newbies" "To:.*openbsd-newbies at sfobug.org")
>         ("other" "")))
>
>           The other day I saw an article which seemed to say that I
> should be escaping the dots in the domain names with double slashes.
>           Is this right?
Yes, technically it's right, but it hasn't bitten me (yet), and to be
honest, it's a lot easier to read without all those slashes. Besides,
you've got your catch-all group down the bottom, mail isn't just going
to go missing if you get the regexp wrong.

<I don't have emacs pinky>
The reason for the double slash is so that the string parsing
passes a single slash down to the regular expression engine, otherwise
it will gobble up `\.' and pass down a single '.' which is not what
you want. 
</I don't have emacs pinky>

The only real suggestion I can give you is to use a header set by the
mailer daemon for matching on, something like List-Id, X-Loop or
Sender, don't rely on user input; they're nearly always human.

hope that helps,
-- 
Clinton Roy

Meetings - ``Try, or no try; there is no do.''

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list