/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([az]{2,4}|\d+)$/i
/ = Start expression
^ = The corresponding line should begin here and begin here
\w = any word (letters, numbers, underscores)
+ = match the previous expression at least once, an unlimited number of times
[] = matches any character inside the brackets, but matches only one \+\. = matches literal + or .
\w = another word
- = match literal -
* = matches the previous expression zero or infinite time
@ = matches the @ character
() = make everything in parentheses a group (and make them reference)
[] = different character set
\w- = match any word or literal -
+ = other 1 to infinity quantifier
\. = match another literal .
* = other 0 to infinity quantifier
\w+ = match a word at least once
[\w-]*\. = match a word or dash at least at zero time, followed by a letter .
() = another group
[az]{2,4} = match lowercase letters at least 2 times but not more than 4 times
| = "or" (does not match the channel)
\d+ = match at least 1 digit
$ = end of line
/ = end of expression i = check string in case of i nsensitive way
Or you could try this awesome link . You know anything.
source share