Regular expressions of numbers, 26 English letters, underscores, or Chinese characters __ regular expressions

Source: Internet
Author: User
Reprint Address: https://blog.csdn.net/qiaoxinde/article/details/49783491 Regular expressions of numbers, 26 English letters, underscores, or Chinese charactersBlog Category: JS regular expression

HTML code    1. A string of numbers, 26 English letters, or underscores:       ^[0-9a-zA-Z_]{1,}$   2. nonnegative integers (positive integers  + 0 ):       ^/d+$   3.  positive integers:       ^[0-9]*[1-9][0-9]*$   4. Non-positive integers (negative integer  + 0):        ^ ((-/d+) | ( 0+) $   5.  negative integer  :       ^-[0-9]*[1-9][0-9]*$   6 integer:            ^-?/d+$   7. Non-negative floating-point number (positive floating-point number  + 0):        ^/d+ (/./d+)?$   8. Positive float  :        ^ ([0-9]+/. [0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*/. [0-9]+) | ([0-9]*[1-9][0-9]*)] $   9.  non-positive floating-point numbers (negative floating-point number  + 0):       ^ (-/d+ (/./d+)?) | (0+ (/.0+)) $   10. Negative floating-point number  :       ^ (-([0-9]+/.[ 0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*/. [0-9]+)| ([0-9]*[1-9][0-9]*))] $   11.  floating-point number  :       ^ (-?/d+) (/./d+)?$   12. A string consisting of 26 English letters  :           ^[A-Za-z]+$   13.   A string of 26 uppercase letters  :       ^[A-Z]+$   14. A string consisting of 26 lowercase letters  :       ^[a-z]+$   15.  A string of numbers and 26 English letters  :       ^[A-Za-z0-9]+$   16. A string of numbers, 26 English letters, or underscores  :            ^/w+$   17.email Address  :       ^[/ w-]+ (/.[ /w-]+) *@[/w-]+ (/.[ /w-]+) +$   18.url:           ^[a-za-z]+://(/w+ (-/w+) *)(/. (/w+ (-/w+) *)) * (/?/s*)?$   19.  year-month-day:       /^ (D{2}|d{4})-((0 ([1-9]{1})) | ( 1[1|2])-(([0-2] ([1-9]{1})) | ( 3[0|1]) $/   20. Month/day/year: &NBsp;      /^ ((0 ([1-9]{1})) | ( 1[1|2]))/(([0-2] ([1-9]{1})) | ( 3[0|1])/(d{2}|d{4}) $/   21.emil:       ^ ([w.] +) @ ([[0-9]{1,3}. [0-9] {1,3}. [0-9] {1,3}.) | (([w-]+.) +)) ([a-za-z]{2,4}| [0-9] {1,3}) (]?) $   22.  Phone number:        (d+-)? (d{4}-?d{7}|d{3}-?d{8}|^d{7,8}) (-d+)?   23.IP address:       ^ (d{1,2}|1dd|2[0-4]d|25[0-5]). (D{1,2}|1dd|2[0-4]d|25[0-5]). (D{1,2}|1dd|2[0-4]d|25[0-5]). (d{1,2}|1dd|2[0-4]d|25[0-5]) $   24.  a regular expression that matches Chinese characters:       [/u4e00-/ u9fa5]   25. Matching double-byte characters (including Chinese characters):       [^/x00-/xff]   26.  Regular expressions that match empty rows:       /n[/s| ]*/r   27. Regular expressions that match HTML tags:       /< (. *) >.*<///1>|< (. *)  //>/   28. Regular expression:  matching the end-and-end spaces        (^/s*) | (/s*$)    29.A regular expression:       /w+ that matches an email address ([-+.] /w+) *@/w+ ([-.] /w+) */./w+ ([-.] /w+) *   30.  The regular expression:       ^[a-za-z]+://(//w+) *) (//) that matches the URL of the URL. ( w+ (-//w+) *)) * (//?//s*)?$   31.  Match account number is legal (start letter, allow 5-16 bytes, allow alphanumeric underline):        ^[a-zA-Z][a-zA-Z0-9_]{4,15}$   32.  Matching domestic phone number:  

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.