The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

regex filters not working properly

Discussion in 'E-mail Discussions' started by oulzac, Jan 2, 2009.

  1. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    I am trying to use the Account Level Filtering function, with a very simple "To: matches regex" rule. But the regex is not working as expected.

    To: matches | regex | m\..+@domain.com | redirect to

    This should match "To: m.xyz@domain.com"
    But should not match "To: mz.xyz@domain.com"

    But it is matching to both, and when I check the filter it appears as this:
    m\\..+@domain.com

    its double escaping?

    Anyone have any feedback on this?
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I reported the double slash issue to the developers.

    As for the filtering issue, how are you testing the filter? Are you using exim, or the Filter Test system within cPanel?
     
  3. oulzac

    oulzac Well-Known Member

    Joined:
    Aug 7, 2005
    Messages:
    131
    Likes Received:
    0
    Trophy Points:
    16
    I am using the the Filter Test system within cPanel on the filter page itself
     
  4. exdiogene

    exdiogene Member

    Joined:
    Apr 23, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Any update concerning this issue?

    I also had many problems trying to escape "[" in my filters.

    If i put something like "\[" in my regex i would get this error message :

    "... missing terminating ] for character class ..."

    It is also impossible to add any white space detection as "\s".

    The problem seem to be related with the "\" processing...
     
  5. malc_b

    malc_b Registered

    Joined:
    Aug 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I see the same error. The \ seems not to work for anything. A tip for anyone trying to do \b i.e. \bdomain\b to accept domain and reject adomain2 is to use [^a-zA-Z_0-9] instead of \b. That works and matches anything that is not A to Z in upper or lower case, not _, and not a digit. So it works the same a \b.

    For \s [ ], [ ]*, [ ]+ seem to work. Likewise for [ or ] then [[] and []] seems to work.
     
  6. creacog

    creacog Registered

    Joined:
    Feb 19, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
Loading...

Share This Page