Till now I have created a regular expression as
Pattern="^(?=.*[a-zA-Z].*)([a-zA-Z0-9._%+-]+@([a-zA-Z0-9-]+[a-zA-Z0-9-]+(\.([a-zA-Z0-9-]+[a-zA-Z0-9-])+)?){1,4})$"
which satisfies conditions as
- All should not be numbers as
[email protected]
- The mail id should not be made up of special characters as
###@###.###
- It should validate
something@something
or[email protected]
Now I want a condition as
- There should only be two periods before and after
@
, which means[email protected]
should be valid and[email protected]
should be invalid.
How to modify this regex for the above condition?