Mobile (China Mobile phone number):
The code is as follows
Copy Code
regexp= "^ ((d{3}) | ( d{3}-))? 13[456789]d{8}|15[89]d{8} "
Verify if the phone number is a regular
The
Use the js regular expression to verify the mobile phone number, email address, and zip code. If you want to verify your mobile phone number, you can refer to it for reference. (11 digits are entered at the beginning of "13" and "158,159)
The
China's mainland operators of mobile phone number standard format is: Country code + mobile phone number, such as: 8613912345678. Features such as the following:1. length 13;2. Begin with 86 of the country code;3. Each digit of th
Converts a 12-bit cell phone number (11 digits before 0, such as 013482339442), converting 12 to 8421 yards, and then combining them into 6 byte arrays, tentatively named BCD6, the conversion method is as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Namespace Consoledemo
{public
class BCD6
{public
string Getmobileno (byte[] mobilearray)
This article describes the JS and jquery verified e-mail, mobile phone number, zip code method.
jquery Code:
Verify ZIP code
$ ("#postcode"). blur (function () {
//Get Postal code
var postcode=$ ("#postcode"). Val ()
Verification of mobile phone numbers (starting with 13 and starting with 158,159, 11 digits in total)Copy codeThe Code is as follows:Var re;Var ss = document. getElementById ('textbox3 '). value;Re =/^ (13 [0-9] {9}) | (15 [89] [0-9] {8}) $/If (re. test (ss )){Document. getElementById ('label3'). innerText = ""; // assign a value to the label using innerText}Else{Document. getElementById ('label3'). innerTe
The code is as follows
Copy Code
function Funcmtel ($STR)//mobile number Regular expression test{Return (Preg_match ("/(?: 13d{1}|15[03689]) d{8}$/", $str))? True:false;}
Test
18678785887
Return to
False
Cause analysis, see the discovery that the above is only validated with 13, 15, the beginning of the natural 18 is not available
A
To judge the principle of mobile phone number operatorMobile phone number by the National Ministry of Information Industry Unified planning, 11-digit number planning fully consider the number of capacity and
Function name: CheckUser ($C _user)
Role: To determine whether a legitimate user name
Parameters: $C _user (user name to be detected)
Return Value: Boolean value
Note: none
The code is as follows
Copy Code
function CheckUser ($C _user){if (! Checklengthbetween ($C _user, 4)) return false; Width testif (!ereg ("^[_a-za-z0-9]*$", $C _user)) return false; Special character te
database has seven fields: Id (identifier), Startno (start number), Endno (ending number), Sheng (Number of provinces, autonomous regions or municipalities), Shi (number City), Tmobile (operator), Cardtype (type of card).
Finally, add two using commands in the form Form1.cs page: Using System.IO and Using System.Data
This example needs to verify the content: E-mail address, URL address, telephone number, ZIP code, verification method for everyone to share for reference, the specific content as follows
1. Verification of e-mail address
2, the URL address of the check
3. Telephone number
4, the verification of the ZIP code
Nonsense not much to say directly on the code
HTML code:
JS code:
The above is a small set of JS to introduce the realization of form verification function (verify the existence of mobile phone number, verification
This article introduces the use of jquery to verify the mailbox, verify the mobile phone number, the specific implementation of ideas and code as follows, interested friends can learn to
copy code code as follows:
//jquery Verify mailbox Function Checksubmitemail () { i
protected void Button1_Click (object sender, EventArgs e){if (Regex.IsMatch (TextBox1.Text.Trim (), @ "^\d{7,11}$")){String num = TextBox1.Text.Trim (). Substring (0, 7);DataRow dr = DAL.oledb.ExecuteDataRow ("Db.mdb", "SELECT * from list where num =?", num);if (dr! = null){Response.Write (TextBox1.Text.Trim () + "}}}ASP. NET implementation of mobile phone number attribution to query, the
At work, there are always a lot of text boxes that prohibit non-numeric character input, such as the mobile phone number and the zip codeCopy codeThe Code is as follows:
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.