Pattern: Email address
“Email address” is one of the patterns that you can select on the Match panel. Use this pattern to make a field match an email address. You can set the pattern to allow any email address, or only email addresses for specific users or specific domains.
This example shows how you can use the “email” pattern to look for email addresses. You can find this example as “Pattern: email (any)” in the RegexMagic library.
- Click the New Formula button on the top toolbar to clear out all settings on the Samples, Match, and Action panels.
- On the Samples panel, paste in one new sample:
support@regexmagic.com
sales@regexmagic.com
- On the Match panel, set “begin regex match at” to “start of word”, and set “end regex match at” to “end of word”.
- Click the
button to add field
.
- In the “pattern to match field” drop-down list, select “email”.

- Set the “field validation mode” to “average”.
- On the Regex panel, select “Python 3.13” as your application, turn off free-spacing, and turn off mode modifiers. Click the Generate button, and you’ll get this regular expression:
\b[!#$%&'*+/0-9=?_`a-z{|}~^-]++(?:\.[!#$%&'*+/0-9=?_`a-z{|}~^-]++)*+@(?:[0-9a-z-]{1,63}\.)+[a-z]{2,63}\bRequired options: Case insensitive.
Unused options: Exact spacing; Dot doesn’t match line breaks; ^$ don’t match at line breaks.
- The Samples panel now highlights the email addresses our regex matches:
support@regexmagic.com
sales@regexmagic.com
Specific Email Addresses
Generating a regex that matches any email address is trivial with RegexMagic. Then again, picking such a regex from an online library of regular expressions is trivial too. What you can do with RegexMagic’s email pattern that you can’t do with copy-and-paste from the web is to generate a regex that matches specific email addresses.
This second example continues from the one above. It shows how you can use the “email” pattern to look for specific email addresses. You can find this example as “Pattern: email (specific)” in the RegexMagic library.
- On the Match panel, set the “user name” option for the email pattern to “specific user names only”. Enter support as the user name we want.
- Set the “domain name” option for the email pattern to “any domain on specific TLDs”. Enter com as the top-level domain (TLD) that we want.

- Make sure the Generate button is still pressed on the Regex panel and you’ll get this regular expression:
\bsupport@(?:[0-9a-z-]{1,63}\.)+com\bRequired options: Case insensitive.
Unused options: Exact spacing; Dot doesn’t match line breaks; ^$ don’t match at line breaks.
- The Samples panel now shows that our regular expression only matches email addresses on the .com domain that have “support” as the user name:
support@regexmagic.com
sales@regexmagic.com
Related Examples
Reference