^(?!.@.@) Asserts that the string does not contain two consecutive “@” symbols.
** (?!.*..)**
Ensures that there are no consecutive periods (“.”) in the string.
^[a-zA-Z0-9._%+-]{1,64}@ Matches an email address with a maximum length of 64 characters before the “@” symbol. It allows alphanumeric characters, dots, underscores, percent signs, plus signs, and hyphens.
([a-zA-Z0-9.-]+.[a-zA-Z]{2,}(?:.[a-zA-Z]{2,255})?)$
Captures the domain part of the email address. It allows alphanumeric characters, dots, and hyphens.
(?:.[a-zA-Z]{2,255})? This group allows for optional subdomains (e.g., “.foo.bar”).
If you have any improvements or issues: Cxbersxnic - Github