P

Visitor

 • 

11 Messages

Thursday, April 20th, 2023 2:26 AM

Closed

Regex expression to find specific words within the subject line or body of email (content) regardless of case and plurals

Hello..

I have been working on a regex expression that would do word matches against the verbiage in the subject line and the body of an email for the purpose of deleting these emails.

A portion of the expression I have been using so far is:

\b\w*(companionship|handsome|relationship|refinance|gutter|cleanse|dating|pain|knee|joint|pain||hemorrhoid|hemorrhoids|diabetes)\w*\b

There are two things that I have not been able to figure out is how to do.

- Make the match of words be case insensitive for all of the words in the list

- How to deal with plurals, such as hemorrhoid/hemorrhoids.

Are there additional regex parameters that will do either of those things when added to the expression?

My thanks for your help!

Paul

Accepted Solution

Gold Problem Solver

 • 

26.3K Messages

2 years ago

​- Make the match of words be case insensitive for all of the words in the list​

If you're asking about Comcast's "Appsuite" Open-Xchange webmail, all Regex string comparisons appear to be preset as case-insensitive.

​- How to deal with plurals, such as hemorrhoid/hemorrhoids.​

For regular nouns that form plurals by simply adding an "s" as above, the form "words?" should work: the ? makes the "s" optional. But it gets a lot messier if you want to match words with more complicated plural forms like "tomato" ("tomatoes"), "party" ("parties"), and "leaf" ("leaves").

More Appsuite/Regex filter info at:

     https://documentation.open-xchange.com/components/middleware/http/7.10.6/index.html#mail-filter

     https://forums.xfinity.com/conversations/email/email-filter-rules-difference/62fab3e42ff2c66589fcf7d5

     https://datatracker.ietf.org/doc/html/draft-murchison-sieve-regex#section-3

Please be aware that there are 2 kinds of responses in this Forum: Replies and Comments. When you Comment on a post by scrolling down to "Comment on this post here...", I am notified of your response. But if you select Reply, I am NOT notified and may not be aware of your response.

(edited)

forum icon

New to the Community?

Start Here