On 02/26/2016 09:02 PM, Stephen J. Turnbull wrote: > On Mailman-Users, Mark Sapiro writes: > > > Further, in the ban_list (and many other places in Mailman) if an > > address is intended to be a regular expression pattern, it must begin > > with '^', so you really want > > > > ^.*@domain\.com$ > > > > to match any_addr...@domain.com. > > I hope we haven't propagated this rather user-unfriendly interface > (the convention of accepting both regexps and literals, distinguishing > by "^" in column 0) to Mailman 3. Even as a Python programmer, I find > Mark's post somewhat confusing: I would design filters using > re.search, so that the above would actually be equivalent as a Python > regular expression to r"@domain\.com$". OTOH, if the implementation > uses re.match, the "^" is redundant, so I have a "say what?!" event.
I agree it's confusing, and I've been caught in this confusion myself and neglected to put the leading ^ in what I clearly intended to be a regexp, but the convention goes back a long way in MM2. > If we have, I propose changing it to > > Ban these addresses, one entry per line: [ ] > [ ] Entries are regular expressions. > > or something like that. We also ought to have a "Python features for > Mailman administrators" section of the FAQ, starting with "what is a > regular expression", and giving examples of how to accomplish common > tasks like banning a whole domain with regular expressions. Typical > regexp FAQs are hard for non-programmers (and even beginning > programmers) to grasp. > > I don't have time to actually work on these now, but if there's uptake > on the suggestion ("let's think about it" at +0 or above :-) I'll file > issues. I'm not sure what the MM3 story is at this point, but +1 for Steve's idea. -- Mark Sapiro <m...@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan _______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org Security Policy: http://wiki.list.org/x/QIA9