Link to home
Start Free TrialLog in
Avatar of itsecurityteam
itsecurityteam

asked on

Regular Expression for chain mail message.

Hello Experts,

I am trying to write a regular expression to block chain mails. The current line I am trying to detect is "send this to at least 10 people" however I want to match based on any number of people and ignores case. I am currently using Ironport as our mail filtering solution. Here is what I have so far:

\Qsend this to at least\E [0-9]

Also, does anyone have any other tricks to catch chain mails.. Thanks
Avatar of Ionut A. Tudor
Ionut A. Tudor
Flag of Romania image

below regex will match any of the following:
send this to at least 10 people
send this to at 10 people
send   this   to  10 people
send   to  14 people
send   to   people
Hope it helps. Cheers

/send(?:\s{1,}this)?\s{1,}to(?:\s{1,}at)?(?:\s{1,}least)?[\s0-9]{1,}people/im

Open in new window

Avatar of itsecurityteam
itsecurityteam

ASKER

I like this however it does not ignore case. Can you write it to ignore the upper or lowercase of any letter? I checked the documentation on the Ironport and it uses Python for its regular expression. Dont know if this helps.
ASKER CERTIFIED SOLUTION
Avatar of Ionut A. Tudor
Ionut A. Tudor
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your prompt response!