Can someone explain what this regular expression email means?
^(([^<>()[\]\\.,;:\ 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 the parts of the regular expression, but not the whole expression, for example
([^<>()[\]\\.,;:\ s@ \"]+(\.[^<>()[\]\\.,;:\ s@ \"]+)*)
matches one or more characters that are not characters
<>()[\]\\.,;:\ s@ \" \\ Not sure what this [\]\\ and \ s@ \ means I could understand some other parts, 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 ) )$ 
