Cannot formulate regex

Dotan Cohen dotancohen at gmail.com
Sun Sep 16 18:06:08 CEST 2007


On 16/09/2007, Paul McGuire <ptmcg at austin.rr.com> wrote:
> On Sep 16, 10:18 am, "Dotan Cohen" <dotanco... at gmail.com> wrote:
> > 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
>
> Or you could try using "MegaRegex"!  I do and my girlfriend can't stop
> talking about it! :)
>

Hehe, thanks Paul. I should have though of the * myself... Got the job done.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

--

א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


More information about the Python-list mailing list