A regex is a regular expression: it's a pattern that describes a set of strings, typically a subset of the set of all possible strings. All special characters a regex can use are explained in the question that your question has been marked a duplicate of.
But specifically for your case; there's a nice tool that can explain regexes here:
NODE EXPLANATION
--------------------------------------------------------------------------------
\b the boundary between a word char (\w) and
something that is not a word char
--------------------------------------------------------------------------------
[\w.-]+ any character of: word characters (a-z, A-
Z, 0-9, _), '.', '-' (1 or more times
(matching the most amount possible))
--------------------------------------------------------------------------------
@ '@'
--------------------------------------------------------------------------------
[\w.-]+ any character of: word characters (a-z, A-
Z, 0-9, _), '.', '-' (1 or more times
(matching the most amount possible))
--------------------------------------------------------------------------------
\. '.'
--------------------------------------------------------------------------------
[A-Za-z]{2,6} any character of: 'A' to 'Z', 'a' to 'z'
(between 2 and 6 times (matching the most
amount possible))
--------------------------------------------------------------------------------
\b the boundary between a word char (\w) and
something that is not a word char
Validating email addresses, the right way
But if you're using PHP >= 5.2.0 (which you probably are), you don't need to use a regex for that. It's much clearer code to use the built-in filter_var():
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
// email valid
} else {
// email invalid
}
You don't have to worry about boundary cases or anything.