Mail filter RegEx help

GreGorGy

BULLSFAN
Joined
Jan 18, 2005
Messages
15,290
Reaction score
1,527
Location
Benoniebfkweesnie
Regex isn't my strong point. My hostgator mail filter allows for regex blocking and of late I have gotten a few spams with the following in the body:
Code:
<img src="http://www.somerubbish.com/[email protected]">

I want a regex that will match the above where the only thing that changes is somerubbish.
 
Guys... come now...

First off:

Matches everything in the HTML tag (DENY ALL HTML TAGS)
Code:
<[^<]+?>

Matches everything in the HTML tag that explicitly uses "img src" (DENY ALL "img src" TAGS):
Code:
<(?i:img\ssrc)[^<]+?>

And what you asked for with added sexy:
Code:
<(?i:img\ssrc\W+)(?i:https?://)((?:[\w]+\.)+)([a-zA-Z]{2,4})/unsubscribe\.php\?email=([\w-\.]+)@((?:[\w]+\.)+)([a-zA-Z]{2,4})">

You can ask for the POSIX alternative if your filter cant do PCRE.

PS: Please for the love of whatever God you believe in... stop using "*"

Buy me a steak and I will teach you all you need to know on Regex in 3 hours :P

You will be able to do Regex like this after I'm done with you:
GcrIkeh.gif
 
Last edited:
fff4skin - You're in Cape Town - how can I buy you a steak?


I will read these again tomorrow and feedback but Mud's answer is working for the moment.
 
Greg, Mud's answer is correct. But from someone who has built and managed far too many mail systems... It is far to static.

Also next time I am in JHB:
a80b835f-a91c-4e91-b956-5d49d6dcd470
 
Top
Sign up to the MyBroadband newsletter
X