Use a regular expression to verify the email address and mobile phone number
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform
Use a regular expression to verify the email address and mobile phone number.
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform
Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn common regular expressions to verify information, such as the website email phone number.
/*** Common regular expressions are used to verify information, such as the mobile
Preface:
Use background: In the project use process, the customer needs the project to connect the mobile, the Unicom, the telecommunication three big carrier short message transmission function, but for the non-local (here for Shanghai) mobile number, because the authority cannot send, therefore requests in the system page to the handset number attribution place to mark.
Use process:
There are probably
This article is also a collection of a large number of JS verification of mobile phone number code, all from the network, if you are not very understanding, you can directly take us now mobile phone number verification code to use OH.
JS
Php regular expression (1 ): verification mobile phone number This article introduces the character group, quantifiers, start/end position of the string, group, selection structure, reverse reference, and name in the regular expression by gradually improving a regular expression for verification mobile phone number gro
Use JavaScript to verify the regular expression of the mobile phone number. The Code is as follows:
Function checkMobile () {var phone = document. getElementById ("phone"). value; var reg0 =/^ 13 \ d {5, 9} $/; // 130--139. At least 7-bit var reg1 =/^ 153 \ d {8} $/; // Chi
In the project, we are validating the user's input, the simplest way is to use regular expression, iOS system also provides a very convenient way, so that we can easily verify the user name, password, id good, mobile phone number, etc.Here is a validation method for the regular expression I used in my project,Due to the more commonly used, it is best to encapsula
This article describes how to use jquery to verify your email address and mobile phone number. The specific implementation ideas and Code are as follows:
The Code is as follows:
// Jquery verification emailFunction checkSubmitEmail (){If ($ ("# email"). val () = ""){// $ ("# ConfirmMsg" pai.html ("the email address cannot be blank! ");Alert ("email cannot b
PHP API to get mobile phone number attribution, API mobile phone number
The API interface since the 2011 SAE platform on-line stable operation to date, increased the support of section
The positive of the cell phone number verification is:
The code is as follows
Copy Code
var reg =/^0{0,1} (13[0-9]|15[7-9]|153|156|18[7-9]) [0-9]{8}$/;var reg =/^0{0,1} (13[0-9]|15[0-9]) [0-9]{8}$/;
There is also a way of writing
The code is as follows
Copy Code
var regex = {Mobile:/^0? (13[0-9]|15[012356789]|18[0236789]|14[57]) [0-9] {8}$/
Jquery practice case -- verify the mobile phone number and jquery case
If you want to verify the mobile phone number, you need to know the number segment of the mobile
If you want to do a cell phone number verification, then we need to know the number of mobile phone number section.//Mobile number Attribution support Segment: 134 135 136 137 138 139 147 151 152 157 158 159 178 183 184 187 188
C
Here is the regular expression that the mobile official pulled down:Determine if a string is a mobile phone number0 is the cell phone number 1 is not the 11 digit number 2nd code prefix is incorrectUsed to verify the number of dig
code example to verify phone number format:In some forms you need to verify the phone format is correct, of course, there are many ways to verify, the following is a common code.The code is as follows:functionIsMobile (MOBILE) {if
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.