Created
April 10, 2015 09:48
-
-
Save sureshnath/5160762772bc0aa58be4 to your computer and use it in GitHub Desktop.
email regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b | |
https://regex101.com/ | |
/[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b/ | |
[A-Za-z0-9._%-]+ match a single character present in the list below | |
Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] | |
A-Z a single character in the range between A and Z (case sensitive) | |
a-z a single character in the range between a and z (case sensitive) | |
0-9 a single character in the range between 0 and 9 | |
._%- a single character in the list ._%- literally | |
@ matches the character @ literally | |
[A-Za-z0-9.-]+ match a single character present in the list below | |
Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy] | |
A-Z a single character in the range between A and Z (case sensitive) | |
a-z a single character in the range between a and z (case sensitive) | |
0-9 a single character in the range between 0 and 9 | |
.- a single character in the list .- literally | |
\. matches the character . literally | |
[A-Za-z]{2,4} match a single character present in the list below | |
Quantifier: {2,4} Between 2 and 4 times, as many times as possible, giving back as needed [greedy] | |
A-Z a single character in the range between A and Z (case sensitive) | |
a-z a single character in the range between a and z (case sensitive) | |
\b assert position at a word boundary (^\w|\w$|\W\w|\w\W) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks :)
But:
s@[email protected] WAS MATCHING
so I only added ^ and $ to match only once:
now its ok. Thanks @pedrohills