Print Page | Close Window

RegEx

Printed From: LogSat Software
Category: Spam Filter ISP
Forum Name: Spam Filter ISP Support
Forum Description: General support for Spam Filter ISP
URL: https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=6913
Printed Date: 27 December 2024 at 10:36am


Topic: RegEx
Posted By: meatboy
Subject: RegEx
Date Posted: 01 February 2011 at 8:19pm
Hi,  we've been running SF v424.834 for sometime and its been very good. Recently we have been hit with some spam that requires key words to sort them but every time I look at regex, I just can't get my head around it.

I'd like to block an email address used in the text of the spam for example :

info@we-spam.com

Now clearly I could use the "we-spam" text but how do I put this literally into the keyword area, the dash of course has an effect in specifying a range.

Is the correct method to use say we\-spam to remove the metacharacter function of the dash?  Should I be using square brackets as well [we\-spam]  ??

How can I use absolute literal text no matter the character?

Hope this is not too dumb a question. Thanks.



Replies:
Posted By: LogSat
Date Posted: 01 February 2011 at 9:45pm
meatboy,

A RegEx keyword in SpamFilter to block info@we-spam.com would be (the parenthesis are used in SpamFilter to indicate that the keyword is a RegEx expression):
(we\-spam)

you could also use a non-regex keyword by simply spelling out the literal characters you wish to look for:
we-spam




-------------
Roberto Franceschetti

http://www.logsat.com" rel="nofollow - LogSat Software

http://www.logsat.com/sfi-spam-filter.asp" rel="nofollow - Spam Filter ISP


Posted By: yapadu
Date Posted: 02 February 2011 at 10:49am
Hmmm...

I don't even think you need the \- part.  I think you are safe to use (we-spam) because the - is not defined as part of a character set [].

I could be wrong of course as I am no regex expert but the test I just did says you don't need it (but did not seem to hurt putting it in either).

As roberto said, you don't really need regex for that example though.


-------------
--------------------------------------------------------------
I am a user of SF, not an employee. Use any advice offered at your own risk.


Posted By: meatboy
Date Posted: 03 February 2011 at 6:20pm
Thanks guys for the tips and direction. I think I was making it harder than it really is. Maybe just missed something in the instructions. The addition is working really well and a few other tweaks are getting them. My users think its all gone quiet now but really SF is doing all the work!! Clap



Print Page | Close Window