Common regular expressions for Web login and registration pages

Source: Internet
Author: User

User name Regular expression: Alpha/numeric/[email protected] 6-20-bit

var userName =/^[[email protected]]{6-20}$/;

Mobile phone number Regular expression:

var reg_mobile =/^0? (1[3-9][0-9]) [0-9] {8}$/;

Password Regular expression:

var reg_pwd =/^[[email protected]]{6-20}$/;

Trading Password Regular expression:

var deal_pwd =/^[0-9]{6}$/
var deal_pwd =/^\d{6}$/

Bank card Regular Expression:

var Reg_bank =/^0? ([1-9]) [0-9] {15,24}$/;

Postal Code Regular expression:

var reg_post =/^[0-9]{6}$/;

Amount Regular expression: supports two decimal places

var reg_amount =/^ ([[1-9]\d{0-9}) | |] (\.\d{0,2})? $/;

Common regular expressions for Web login and registration pages

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: 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.