[Mailman-Users] Question About Case Handling in Non-member Filters

Mark Sapiro msapiro at value.net
Tue Nov 7 02:39:03 CET 2006


Jon Forrest wrote:

>I woke up in the middle of the night last night
>worried that my non-member filter regular expression
>might not be completely correct.
>
>I have
>
>	^[^@]+@(.*\.)?example\.com$
>
>and what I'm worried about is whether this will
>match any permutation of upper and lowercase.


It will. All the regexps that can be entered on the list admin web
pages are compiled or searched with re.IGNORECASE.


>Python regular expressions are case sensitive,
>I believe, but the function that does the matching
>can be passed an flag that says to not be case
>sensitive. I'm not sure where to look in the
>Mailman source to find where this function is
>called.


If you do

grep -r _these_nonmembers Mailman/*

I'll bet you can figure out which hits are the ones you want.

Also, you can pass the IGNORECASE flag in the expression itself if you
really want the belt and suspenders.

	^(?i)[^@]+@(.*\.)?example\.com$


-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list