In the past, the regular expression was used to open the syntax document of the regular expression, and then re-reference and compare it one by one. Once it is used, it will be left behind, so I forget it every time I use it, every time I come back, no wonder the regular expression is like "tianshu ".
While I am using the email regular expression, my understanding of the Regular Expression of email can be recorded as a case! My email regular is from regexbuddy's library, as follows:
\ B [A-Z0-9. _ %-] + @ [A-Z0-9. _ %-] + \. [A-Z] {2, 4} \ B
You can open the regular expression syntax document (that is, the regular expression chapter in the Javascript Manual)
In comparison, the regular expressions mainly include:
\ B Indicates matching a word boundary
[A-Z0-9. _ %-] indicates characters that can match A-Z 0-9. _ %-
+ Indicates a character that can match 1-N A-Z 0-9. _ %-
@ Special characters of the email
[A-Z0-9. _ %-] is similar
\. Indicates matching. Because. is a special character in a regular expression, it must be escaped \.
[A-Z] {2, 4} indicates 2 to 4 characters configuring a-z
\. [A-Z] {2, 4} \ B the entire view is that the last word must be 2-4 characters, with a vertices in front.
Last
Several Regular Expression debugging tools are recommended.
Http://www.cnblogs.com/Heroman/archive/2005/01/13/91265.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.