[Mailman-Users] Regular expressions in list config files?

Mark Sapiro mark at msapiro.net
Tue Feb 19 17:35:12 CET 2008

bernholdtde at ornl.gov wrote:
>If I use a simple regex, like 
>			 '^x-spam-flag: *yes'
>it seems to show up properly in the configuration.  But if I use a
>more precise regex that accounts for all forms of whitespace with the
>"\s" sequence, like this
>		     '^\s*x-spam-flag:\s*yes\s*$'
>then what appears in the config file is 
>		   '^\\s*x-spam-flag:\\s*yes\\s*$'
>in other words the backslashes have been quoted and are now literals.

Are you saying you see this with bin/dumpdb of the config.pck. If so,
that's just the way python is showing the representation of the
string. It is not the actual value of the string. If you doubt that,
try 'strings' instead of 'bin/dumpdb'.

Also note the initial \s* in '^\s*x-spam-flag:\s*yes\s*$' really does
nothing since if 'x-spam-flag:' is preceded by whitespace, it isn't a
header. I.e., none of the headers presented to header_filter_rules
regexps have leading whitespace.

Mark Sapiro <mark at msapiro.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