On 06/03/2018 04:28 PM, Mark Dale wrote: > >> I use this regexp in the GLOBAL_BAN_LIST >> >> ^[0-9a-z.]{8,}\+[0-9a-z]{4,}@gmail\.com$ > > I'm getting errors with the above however it seems to do the job > if I enclose it in quotes and remove the trailing $ - like so: > > GLOBAL_BAN_LIST = ['^[0-9a-z.]{6,}\+[0-9a-z]{4,}@gmail\.com']
What you have done is correct. I don't know why you would have needed to remove the '$'. Did you get an error and if so, what?. The regexp I gave was just intended to be an example regexp. The BAN_LIST is actually a list of strings so regexps in the BAN_LIST have to be quoted and enclosed in [] and comma separated if more than one. Also, it doesn't matter in this case because \+ and \. are not meaningful string metacharacters, but it never hurts to define them as raw strings like, e.g., GLOBAL_BAN_LIST = [r'^[0-9a-z.]{8,}\+[0-9a-z]{4,}@gmail\.com$'] -- Mark Sapiro <m...@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/archive%40jab.org