English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to create a regex spam filter. E-mails for viagra/cialis/etc have been getting through our filter. The batch that is getting through take the form of:

VIAGeRA
CIALeIS

I also want to make sure that other variations are blocked. I've also seen it with spaces between each letter, such as:

V I A G R A
C I A L I S

I'm thinking something like this:

[Vv][Ii1]Aa][Gg][Rr][Aa]

but how do I account for spaces and other characters that may be inserted between the main word?

2006-07-14 05:32:05 · 0 answers · asked by Anonymous in Computers & Internet Programming & Design

0 answers

you can use wild card characters.

Perl and POSIX regular expressions use . as the wild card character, then you just have to add a repeat after it if you want more such as ? (1 or 0), * (0+) +(1+) or {x,y} (x to y), you just have to worry about valid words or phrases that might have those characters in that order if you use the * operator.

2006-07-14 05:36:15 · answer #1 · answered by John J 6 · 0 0

Just use Regex.String(Replace(myString, Chr(32), ""), ", Regex.IgnoreCase) Where searchString is the String you are searching for.

So if searching for Viagra or something else, you will find it

Helmut

2006-07-14 06:52:15 · answer #2 · answered by hswes 2 · 0 0

fedest.com, questions and answers