^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))
@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)
+[a-zA-Z]{2,}))$
I could only understand parts of the regex but not the entire expression , like
([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)
match one or more characters that's are not the characters
<>()[\]\\.,;:\s@\" \\ Not sure what this [\]\\ and \s@\ means
I could understand some of the other parts as well but not as a single entity.
Here you go:
^(
(
[^<>()[\]\\.,;:\s@\"]+ // Disallow these characters any amount of times
(
\. // Allow dots
[^<>()[\]\\.,;:\s@\"]+ // Disallow these characters any amount of times
)* // This group must occur once or more
)
| // or
(\".+\") // Anything surrounded by quotes (Is this even legal?)
)
@ // At symbol is litterally that
(
// IP address
(
\[ // Allows square bracket
[0-9]{1,3} // 1 to three digits (for an IP address
\. // Allows dot
[0-9]{1,3} // 1 to three digits (for an IP address
\. // Allows dot
[0-9]{1,3} // 1 to three digits (for an IP address
\. // Allows dot
[0-9]{1,3} // 1 to three digits (for an IP address
\] // Square bracket
)
| // OR a domain name
(
([a-zA-Z\-0-9]+\.) // Valid domain characters are a-zA-Z0-9 plus dashes
+
[a-zA-Z]{2,} // The top level (anything after the dot) must be at least 2 chars long and only a-zA-Z
)
)$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With