Sender blacklist with regular expression RSS

1

Need some guidance with regex. We have two email address formats; and . The numbers on the second example range from 00-99. I would like to blacklist all senders that have any number between 00-99 at the end of their username before the @domain.com. Many thanks.

by Quilliby 5 years ago
2

@Quilliby: In that case, the regex would be

.*\d{2}@domain\.com$

This means "any characters, any number of repetitions; followed by 2 digits; followed by @domain.com, end of string". Note that "any characters, any number of repetitions" includes digits as well, so this will also match "". If the username part preceding the 2 digits should allow only letters (no numbers, dots, dashes, underscores, etc.), try

[a-z]*\d{2}@domain\.com$

If letters, dashes, dots, underscores are allowed in the username part, preceding the 2 digits, try:

[a-z_\.-]*\d{2}@domain\.com$

by Krisztián Fekete (Vamsoft) 5 years ago
(in reply to this post)

New comment

Fill in the form below to add a new comment. All fields are required. If you are a registered user on our site, please sign in first.

Nickname:
Email address (will not be published):
Your comment:

ORF Technical Support

Configuring, installing and troubleshooting ORF.

News & Announcements

Your dose of ORF-related news and announcements.

Everything but ORF

Discuss Exchange and system administration with fellow admins.

Feature Test Program

Feature Test Program discussion. Membership is required to visit this forum.

ORF Beta

Join the great bug hunt of the latest test release.

Customer Service

Stay Informed