Regular validation collection (mobile phone number, province certificate, email, etc.)

Source: Internet
Author: User

Original link: JS latest mobile phone number, phone number regular expression

  1. Mobile number:/^1[34578]\d{9}$/or/^1 (3|4|5|7|8) \d{9}$/;
  2. Fixed:/^ (\ (\d{3,4}\) |\d{3,4}-|\s) \d{7,14}$/;
  3. Identity card Regular expression (15-bit):/^[1-9]\d{7} ((0\d) | ( 1[0-2]) (([0|1|2]\d) |3[0-1]) \d{3}$/;
  4. Identity card Regular expression (18-bit):/^[1-9]\d{5}[1-9]\d{3} ((0\d) | ( 1[0-2]) (([0|1|2]\d) |3[0-1]) \d{4}$/;
  5. Regular merger of identity cards: (^\d{15}$) | (^\d{17} ([0-9]| X) $);
  6. To extract information from a network link: (h| H) (r| R) (e| E) (f| F) *= * (' | ')? (\w|\\|\/|\.) + (' | ' | *|>)?;
  7. Message address in Extract information: \w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *;
  8. Extract the image link from the information: (s| S) (r| R) (c| C) *= * (' | ')? (\w|\\|\/|\.) + (' | ' | *|>)?;
  9. Extract the IP address in the information: (\d+) \. (\d+) \. (\d+) \. (\d+);
  10. Chinese phone numbers (including mobile and landline) in the extraction Information:(\ (\d{3,4}\) |\d{3,4}-|\s)? \d{7,14};
  11. Extract the information in China Postcode: [1-9]{1} (\d+) {5};
  12. Chinese identity card number in extracting information: \d{18}|\d{15};
  13. Extract the Integer in the information: \d+;
  14. Extract floating-point numbers (that is, decimals) in information: (-?\d*) \.? \d+;
  15. Extract any number from the information: (-?\d*) (\.\d+)?;
  16. Extract the Chinese string from the information: [\u4e00-\u9fa5]*;
  17. Extract the double-byte string in the information (Kanji): [^\x00-\xff]*;

Regular validation collection (mobile phone number, province certificate, email, etc.)

Related Article

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.