In this blog, we will create a complex E-Mail pattern creation.

Create a complex E-Mail pattern:

Like this pattern innovative_codesacademy.ica1.ica2@gmail.ac.in, here we will create a new pattern for our e-mail, let’s start.

Pattern = “^[_A-Za-z0-9]+(\.[_A-Za-z0-9]+)*@[A-Za-z0-9]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,4})$”

Now we will explain step by step how this pattern creation, first split the pattern

^ – This symbol indicates starting character of the string

1. [_A-Za-z0-9] – In this pattern, Underscore (_)symbol is used for user requirement at a first string, three types of characters are present i.e, Alphabets upper case and Lower case, all Digitel value, Square bracket[ ] indicates to allow set of characters. At this level create a pattern form ( innovative_codesacademy ).

2.+ This operator is used to Concatenate the above and below Strings.

3. (\.[_A-Za-z0-9]+) – In this pattern, add ( . ) then add three types of characters are present i.e, Alphabets upper case and Lower case, all Digitel value, Square bracket[ ] indicates to allow set of characters, finally enclose with parenthesis used to perform other operation like multiple times accept the same pattern repetition, + This operator is used to Concatenate the above and below Strings, the only common use of backslash is to ignore (“escape”) a newline immediately after it.

At this level create a pattern form ( innovative_codesacademy.ica1).

4. * – This operator is used to accepting more repetition by user input.

(EX. innovative_codesacademy.ica1.ica2.ica3@gmail.com)

At this level of creating a pattern form ( innovative_codesacademy.ica1.ica2 ).

5.@[A-Za-z0-9] – In this pattern we create first add @ symbol, then add three types of characters are present i.e, Alphabets upper case and Lower case, all Digitel value, Square bracket[ ] indicates to allow set of characters.

(EX. innovative_codesacademy.ica1.ica2@gmail.ac.in )

At this level of creating a pattern form ( innovative_codesacademy.ica1.ica2@gmail.).

6.+ This operator is used to Concatenate the above and below Strings.

7. (\.[A-Za-z0-9]+) – In this pattern, add ( . ) then add three types of characters are present i.e, Alphabets upper case and Lower case, all Digitel value, Square bracket[ ] indicates to allow set of characters, finally enclose with parenthesis used to perform other operation like multiple times accept the same pattern repetition, + This operator is used to Concatenate the above and below Strings, the only common use of backslash is to ignore (“escape”) a newline immediately after it.

At this level of creating a pattern form ( innovative_codesacademy.ica1.ica2@gmail.ac.).

8.* – This operator is used to accepting more repetition by user input.

(EX. innovative_codesacademy.ica1.ica2.ica3@gmail.ac.in)

9.(.[A-Za-z]{2,4})– In this pattern, add ( . ) then add three types of characters are present i.e, Alphabets upper case and Lower case, all Digitel value, Square bracket[ ] indicates to allow set of characters, finally enclose with parenthesis used to perform other operation like multiple times accept the same pattern repetition, + This operator is used to Concatenate the above and below Strings, {2,4}This is used for insert 2 to 4 characters.

At this level of creating a pattern form ( innovative_codesacademy.ica1.ica2@gmail.ac.in).

10.$ – This symbol is used at the end of the string, its defined string is enough and finish.

At this level of creating a pattern form ( innovative_codesacademy.ica1.ica2@gmail.ac.in).

Are you want to verify this pattern go and see my previous blog use the source code and checked it, that bog link was given below use it and learn it.

http://www.innovativecodesacademy.in/custom-email-pattern-creation-using-regular-expression-method-in-python/

In the next blog, We will explain how to create the pattern for phone number verification? the purpose for each character.

Leave a Reply

Your email address will not be published. Required fields are marked *