Js Regular Expression

Source: Internet
Author: User

Intege: "^ -? [1-9] \ d * $ ", // integer intege1:" ^ [1-9] \ d * $ ", // positive integer intege2: "^-[1-9] \ d * $", // negative integer num: "^ ([+-]?) \ D *\\.? \ D + $ ", // number num1:" ^ [1-9] \ d * | 0 $ ", // positive number (positive integer + 0) num2: "^-[1-9] \ d * | 0 $", // negative (negative integer + 0) decmal: "^ ([+-]?) \ D *\\. \ d + $ ", // floating point decmal1:" ^ [1-9] \ d *. \ d * | 0. \ d * [1-9] \ d * $ ", // Positive floating point decmal:" ^-([1-9] \ d *. \ d * | 0. \ d * [1-9] \ d *) $ ", // negative floating point number decm_3:" ^ -? ([1-9] \ d *. \ d * | 0. \ d * [1-9] \ d * | 0 ?. 0 + | 0) $ ", // floating point decmal4:" ^ [1-9] \ d *. \ d * | 0. \ d * [1-9] \ d * | 0 ?. 0 + | 0 $ ", // non-negative floating point number (Positive floating point number + 0) decmal5:" ^ (-([1-9] \ d *. \ d * | 0. \ d * [1-9] \ d *) | 0 ?. 0 + | 0 $ ", // non-Positive floating point number (negative floating point number + 0) email:" ^ \ w + (-\ w +) | (\\. \ w +) * \ @ [A-Za-z0-9] + ((\\. |-) [A-Za-z0-9] + )*\\. [A-Za-z0-9] + $ ", // mail color:" ^ [a-fA-F0-9] {6} $ ", // color url:" ^ http [s]?: \/([\ W-] + \.) + [\ w-] + ([\ w -./? % & =] *)? $ ", // Url chinese:" [\ u4E00-\ u9FA5 \ uF900-\ uFA2D] + $ ", // chinese only chAndEngAndNumEct: "^ [\ u4E00-\ u9FA5 \ uF900-\ uFA2D \ w +] + $", ascii: "^ [\ x00-\ xFF] + $", // zipcode: "^ \ d {6} $", // mobile: "^ (13 | 15) [0-9] {9} $", // mobile ip4: "^ (25 [0-5] | 2 [0-4] \ d | [0-1] \ d {2} | [1-9]? \ D )\\. (25 [0-5] | 2 [0-4] \ d | [0-1] \ d {2} | [1-9]? \ D )\\. (25 [0-5] | 2 [0-4] \ d | [0-1] \ d {2} | [1-9]? \ D )\\. (25 [0-5] | 2 [0-4] \ d | [0-1] \ d {2} | [1-9]? \ D) $ ", // ip address notempty:" ^ \ S + $ ", // non-empty picture :"(. *)\\. (jpg | bmp | gif | ico | pcx | jpeg | tif | png | raw | tga) $ ", // image rar :"(. *)\\. (rar | zip | 7zip | tgz) $ ", // compressed file xls :"(. *)\\. (xls) $ ", // excel www.2cto.com date:" ^ \ d {4} (\-|\/ | \.) \ d {1, 2} \ 1 \ d {1, 2} $ ", // Date qq: "^ [1-9] * [1-9] [0-9] * $", // QQ number tel: "^ ([0 \ +] \ d {2, 3 }-)? (0 \ d {2, 3 })-)? (\ D {7, 8}) (-(\ d {3 ,}))? $ ", // Telephone number function (including domestic area code, international area code, extension code) netfaxno:" ^ [2-9] [0-9] {6, 7 }", username: "^ \ w + $", // used for user registration. Match A string consisting of digits, 26 English letters, or underscores (_): "^ [A-Za-z] + $", // letter letter_u: "^ [A-Z] + $", // uppercase letter letter_l: "^ [a-z] + $", // lowercase letter idcard: "^ [1-9] ([0-9] {14} | [0-9] {17}) $" // ID card

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.