Trying to create custom email validation for below rules
- The local part can be up to 64 characters in length and consist of any combination of alphabetic characters, digits, or any of the following special characters: ! # $ % & ‘ * + – / = ? ^ _ ` . { | } ~
- The period character (".") is valid for the local part subject to the following restrictions: A. it is not the first or last character B. two or more consecutive periods
- top level domains cannot be all numeric
- hyphens cannot be the first or last character
^([a-zA-Z0-9!#\$%&‘*+/\=\?\^_'`}{\|~-][.]?)@[a-zA-Z0-9]+(?:(.)\0?(?!\1))[a-zA-Z0-9-]*[a-zA-Z0-9]+(.[a-zA-Z0-9]{2,63})+$
First part (before @ )is good but unable to place
- two or more consecutive periods
hyphens cannot be the first or last character
for example
- [email protected](correct)
- [email protected](incorrect)
- [email protected](incorrect)
- [email protected](incorrect)
- [email protected](incorrect)
- [email protected](correct)
- [email protected](correct)
- [email protected](correct)
Please help.