This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

regex help

I see some of you are good with regex from searching the forums. I was wondering if someone could help me. I'm trying the first regtex expression trying to block cialis in emails. at first I just put in the word cialis, but it also blocked lost of email with specialist in it. I then tried to understand the syntax of regex expressions, and thought /\ cialis/ would check for a space before the word, but that didn't block any emails for some reason. I noticed C was in capital, so I changed it to /\ cialis/i and still no luck. Anyone know what expression I could use to block emails with cialis in it, but not emails with specialist or anything other than cialis with a space in front of it? 

Thanks

Brian


This thread was automatically locked due to age.
Parents
  • BarryG, not sure why but that regex isn't catching my test spam. This is the text in body of email "have all the top brands like Cialis
    Vicodin Phentermine Xanax and more for the cheapest prices around all with
    the comfort of your home so you can remain anonymous with extremely prompt
    ordering and descreet shipping."


    Maybe I have to restart the smtp service or commtouch or something. I'll schedule a restart for the weekend to make sure. Do you know if Astaro has documentation on the regex expressions for commtouch anywhere? I checked the kb didn't find anything. Thanks

    Brian
Reply
  • BarryG, not sure why but that regex isn't catching my test spam. This is the text in body of email "have all the top brands like Cialis
    Vicodin Phentermine Xanax and more for the cheapest prices around all with
    the comfort of your home so you can remain anonymous with extremely prompt
    ordering and descreet shipping."


    Maybe I have to restart the smtp service or commtouch or something. I'll schedule a restart for the weekend to make sure. Do you know if Astaro has documentation on the regex expressions for commtouch anywhere? I checked the kb didn't find anything. Thanks

    Brian
Children
  • Brian, I don't think the Expression Filter is part of the CommTouch engine.  In any case, you definitely do not need to restart.

    [^(spe)]cialis\s will block "cialis" but not specialist

    Here's a handy REGEX tester

    Cheers - Bob
    PS Barry, I had to spend a few minutes figuring that you meant \s instead of \w
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA

  • PS Barry, I had to spend a few minutes figuring that you meant \s instead of \w


    Nope, I meant \wcialis\w

    That would definitely work in Perl and anything that uses PCRE.

    \w detects any word boundary, including spaces (\s), periods, colons, etc., so it works better than \s.

    Barry