Skip to main content

Wildcards in account filters

Comments

7 comments

  • Bob Ulius
    Likely should have mentioned I use these as Any Header - Contains - Discard Message.
    0
  • rpvw
    You will probably need to use the 'matches regex' operator rather than 'contains'. See
    0
  • Bob Ulius
    Thanks. Appreciate your reply. Does this search headers only or all of the message? And if I understand what you say, then this: keto.fat.burn Would match these: keto_fat_burn- keto-fat-burn- And so I would not need either the trailing- or the *. Or am I misunderstanding?
    0
  • cPanelLauren
    Does this search headers only or all of the message?

    That depends on what you select for the filter - you'd need to select "Body" "Matches Regex" for this to scan the body of the message.
    And if I understand what you say, then this: keto.fat.burn Would match these: keto_fat_burn- keto-fat-burn- And so I would not need either the trailing- or the *. Or am I misunderstanding?

    He's saying specifically that keto.fat.burn-*
    would match the three terms you listed: keto.fat.burn- keto-fat-burn keto_fat_burn
    instead of keto?fat?burn?
    An explanation of the -* is found at regex101 -* matches the character - literally (case sensitive) * Quantifier " Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
    0
  • Bob Ulius
    Thanks, but forgive me, I still don't know why I need the "*". I am now testing Any Header Matches Regex keto.fat.burn- and seems to be working as I desire. Am I missing something? Will wait to hear before I add bunches more this way. Thanks!
    0
  • cPanelLauren
    If it's matching as you need it then go with it but the * should allow it to be matched as many times in the body as necessary.
    0
  • Bob Ulius
    Ahhh, OK. Key word "body". I am searching any header. And even if it were the body, the filter is set to delete the message as soon as the string is found. Hence "*" not needed. And this seems to be easier and working better to do the matching regex with "." wildcards rather tha any header "contains" and a separate rule for each possibility of separator. Thanks.
    0

Please sign in to leave a comment.