I'm having loads of trouble trying to fulfill the requirements of this regex as stated below.
^[A-Za-z0-9]{1,}|^[A-Za-z0-9]{1,}[\-\_]\.[a-zA-Z]{2,}@[A-Za-z0-9][\-\_]{5,}\.[a-zA-Z]{2,}$
"Your Email and Re-enter email must not be blank and must have the form acct@domain where:
acct- 1 or more characters
- Composed of only upper or lowercase alphabetic characters, numeric characters, dashes, periods, underscores and hyphens
- Contains no embedded blanks.
- Cannot start or end with an underscore, dash, period or hyphen.
- There must be at least two letters before and after every period.
domain- 5 or more characters
- Composed of only upper or lowercase alphabetic characters, numeric characters, dashes, periods, and hyphens, underscores
- Contains no embedded blanks
- Must have at least one period, and cannot start or end with an underscore, dash, period or hyphen.
- There must be at least two letters before and after every period.
- The email address must contain an
@between acct and domain
Sample valid email addresses:
[email protected], [email protected]_3.com
Sample invalid email addresses:
b@b, [email protected], [email protected]!c
Both email addresses must be the same"
_is not a valid character in a domain name.