PHP user registration Information Validation regular expression, user registration regular Expression _php tutorial

Source: Internet
Author: User

PHP user registration Information Validation regular expression, user registration regular expression


The following method of verifying the username is the principle that the user name must be composed of alphanumeric bands with a dash, let's take a look at the example below.

1. Check whether the user name conforms to the specified "two-bit letters, numbers, or underscores", the code is as follows:

/**  * Check if user name is compliant  *  * @param STRING $username username to check  * @return TRUE or FALSE  

More than two letters, numbers, or underscores : ^[a-za-z0-9_\x7f-\xff][a-za-z0-9_\x7f-\xff]+$.

Note: Here, the letters are a-z,a-z, and ASCII characters from 127 to 255 (0X7F-0XFF)

2, Password:6-20-bit, composed of letters, numbers, the code is as follows:

3, email verification , the code is as follows:

This article for everyone to share the user registration information: User name, password and the regular expression of mailbox verification, I hope that we seriously learn this "PHP user registration information Verification Regular expression", will have some gains.

http://www.bkjia.com/PHPjc/1071231.html www.bkjia.com true http://www.bkjia.com/PHPjc/1071231.html techarticle PHP User registration Information Validation regular expression, user registration regular expression The following is the method principle of verifying user name in such a way that the user name must be a group of alphanumeric bands with a set of dashes ...

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