RegEx |
Post Reply |
Author | |
meatboy
Newbie Joined: 26 June 2006 Status: Offline Points: 18 |
Post Options
Thanks(0)
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. |
|
LogSat
Admin Group Joined: 25 January 2005 Location: United States Status: Offline Points: 4104 |
Post Options
Thanks(0)
|
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 |
|
yapadu
Senior Member Joined: 12 May 2005 Status: Offline Points: 297 |
Post Options
Thanks(0)
|
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. |
|
meatboy
Newbie Joined: 26 June 2006 Status: Offline Points: 18 |
Post Options
Thanks(0)
|
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!!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0.094 seconds.