Regular Expression Help for SPAM

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Regular Expression Help for SPAM

Post by pickle »

Hi All,

I've got a SPAM filter on my server which isn't catching a particular phrase, let's call it "dum-shot". Can anyone help me with it? Currently, it's set at "/\bdum[ -]?shots?\b/i", without the double quotes. I need the expression to catch all these phrases:

dum
dumshot
dumshots
dum shot
dum shots
dum-shot
dum-shots

Please help and disregard the vulgarity of the post (blame porn, not me :)).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

'#\b(dum)(ї\s-]?(shots?)?)\b#i'
??
Post Reply