Common jquery numeric type validation Regular expression collation _ regular expression

Source: Internet
Author: User
Copy Code code as follows:

var regexenum =
{
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 numbers
Decmal1: "^[1-9]//d*.//d*|0.//d*[1-9]//d*$",//Positive floating-point number
Decmal2: "^-([1-9]//d*.//d*|0.//d*[1-9]//d*) $",//negative floating-point number
DECMAL3: "^-?" ([1-9]//d*.//d*|0.//d*[1-9]//d*|0?. 0+|0) $ ",//floating-point number
Decmal4: "^[1-9]//d*.//d*|0.//d*[1-9]//d*|0?" 0+|0$ ",//nonnegative floating-point number (positive floating-point number + 0)
DECMAL5: "^ (-([1-9]//d*.//d*|0.//d*[1-9]//d*)) |?" 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}$",//Colors
URL: "^http[s]?:/ ([//w-]+//.) +[//w-]+ ([//w-./?%&=]*)? $ ",//url
Chinese: "^[//u4e00-//u9fa5//uf900-//ufa2d]+$",//Only Chinese
ASCII: "^[//x00-//xff]+$",//only acsii characters
ZipCode: "^//d{6}$",//ZIP code
Mobile: "^ (13|15|18) [0-9]{9}$",//Mobile phone
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) $ ",//Picture
RAR: "(. *)//. (rar|zip|7zip|tgz) $ ",//Compressed file
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,}))? $ ",//Phone number function (including verification of domestic area code, international area code, extension number)
Username: "^//w+$",//for user registration. Match a string of numbers, 26 English letters, or underscores
Letter: "^[a-za-z]+$",//Letters
Letter_u: "^[a-z]+$",//capital Letter
letter_l: "^[a-z]+$",//lowercase letters
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.