Advanced e-mail verification

Report a typo

Regexp tasks authors just love making tasks about e-mail addresses. We are not an exception.

Let's write a template matching an e-mail address. We'll consider the following format of valid e-mail addresses:

  • its first part can contain from 6 to 30 characters. These characters can contain lowercase Latin letters (a-z), digits (0-9), hyphens -, dot characters . , equal signs = or underscores _

  • the second part that immediately follows the first one can be either @gmail.com, @jetbrains.org or @hyperskill.org

  • note that other combinations of the correct domain and top-level domain names are invalid. For example, @jetbrains.com or @gmail.org shouldn't be accepted by your regex.

Put your regex in the template variable.

Some examples of valid e-mails: [email protected], [email protected], [email protected].

Some examples of invalid e-mails: mainadmin@gmail,com, [email protected], [email protected], [email protected].

Make use of the website allowing you to check your expression online to test them in a fast and easy manner.

Write a program in Python 3
import re


template = ''
___

Create a free account to access the full topic