Cannot formulate regex

Dotan Cohen dotancohen at gmail.com
Sun Sep 16 11:18:21 EDT 2007


I'd like to filter spam from a certain company. Here are examples of
strings found in their spam:
Mega Dik
Mega D1k
MegaDik
Mega. Dik
M eg ad ik
M E _G_A_D_ IK
M_E_G. ADI. K

I figured that this regex would match all but the second example, yet
it matches none:
|[^a-z]m[^a-z]e[^a-z]g[^a-z]a[^a-z]d[^a-z]i[^a-z]k[^a-z]|i

What would be the regex that matches "megadik" regardless of whatever
characters are sprinkled throughout?

Thanks in advance.

Dotan



More information about the Python-list mailing list