javascript - Can someone explain what this Email regex 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 understand parts of regex not entire expression , like
([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)
match 1 or more characters that's not characters
<>()[\]\\.,;:\s@\" \\ not sure [\]\\ , \s@\ means
i understand of other parts not single entity.
here go:
^( ( [^<>()[\]\\.,;:\s@\"]+ // disallow these characters amount of times ( \. // allow dots [^<>()[\]\\.,;:\s@\"]+ // disallow these characters amount of times )* // group must occur once or more ) | // or (\".+\") // surrounded quotes (is legal?) ) @ // @ symbol litterally ( // ip address ( \[ // allows square bracket [0-9]{1,3} // 1 3 digits (for ip address \. // allows dot [0-9]{1,3} // 1 3 digits (for ip address \. // allows dot [0-9]{1,3} // 1 3 digits (for ip address \. // allows dot [0-9]{1,3} // 1 3 digits (for ip address \] // square bracket ) | // or domain name ( ([a-za-z\-0-9]+\.) // valid domain characters a-za-z0-9 plus dashes + [a-za-z]{2,} // top level (anything after dot) must @ least 2 chars long , a-za-z ) )$
Comments
Post a Comment