Http://www.cnblogs.com/wuhuisheng/archive/2011/03/23/1992652.html
The main code for phone number verification is as follows:
Public bool istelephone (string str_telephone)
{
Return System. Text. regularexpressions. RegEx. ismatch (str_telephone, @ "^ (\ D {3, 4 }-)? \ D {6, 8} $ ");
}
The main code used to verify the mobile phone number is as follows:
Public boo
HTML code:Total number: The interface is as follows:JS Code:Calculate number of input mobile phone number, verify multi-number, filter duplicate number
Verify the implementation code of the bank card number in JavaScript, and verify the javascript code
1. Introduce jquery. js first
2. Introduce luhmCheck. js // Luhm verification of the bank card number.
3. See the following case:
Below is the js
Test card No:
1. 6222600810010710887
2. 6225881414207430
The above is t
Java uses regular expressions for form validation tools class, can verify mailbox, mobile phone number, QQ number, etc.
Copy Code code as follows:
Package util;
Import Java.util.regex.Matcher;Import Java.util.regex.Pattern;
/*** Use regular expressions for form validation**/
public class Regexvalidateutil {Static Boolean flag = FALSE;static S
Recent projects used in the need to call the real-name authentication interface, real-name authentication interface price compared to SMS is not a bit higher than a few cents, so that the conditions of the call authentication is strict, so use to JS verify the true name and JS authentication ID number.
Get to the point.
1.js Verify real name
JS
PHP Verify credit card number is correct function, PHP verify credit card number
You can use the following PHP functions to verify whether a card number is a credit card:
function Validatecard ($cardnumber) { $cardnumber = pre
Verify that the account is validVerification rules: a combination of letters, numbers, and underscores. It must start with a letter and contain 4-16 characters.
FunctionCheckuser (STR ){VaRRe=/^ [A-Za-Z] \ W {3, 15} $/;If(Re. Test (STR) {alert ("Correct");}Else{Alert ("Error") ;}} Checkuser ("jiade_cnblogs");//Call
Verify mobile phone numberVerification rules: 11-digit
/********************Function Name: Istelephonefunction function: fixed, mobile phone number check function, return True, reverse, return falsefunction parameters: obj, number to be checkedCheck rule:(1) Number, "(", ")" and "-"(2) The phone number is 3 to 8 digits(3) If the phone
[0-9a-z] [a-z0-9\._-] {1,}@[a-z0-9-]{1,}[a-z0-9] (\.[ A-z]{1,}) +Many of the verification mailboxes that were found on the Internet do not support the verification of mailbox of level two domain nameHow to use JSfunction checkemail (email) { if (/^[0-9a-z][a-z0-9\._-]{1,}@[a-z0-9-]{1,}[a-z0-9] (\.[ A-z]{1,}) +$/. Test (email) { returntrue; } return false ;}How to use C #classProgram {Static voidMain (string[] args) {Console.WriteLine (Checkemail ("[email protected]")); Consol
This article mainly introduces the JS code to verify the phone number and phone number is legitimate, mobile phone number and phone number in some sites are required, in order to improve the user experience, the general to verify
Recent projects used in the need to call the real-name authentication interface, real-name authentication interface price compared to SMS is not a bit higher than a few cents, so that the conditions of the call authentication is strict, so use to JS verify the true name and JS authentication ID number.
Get to the point.
JS Verify the real name, is used to match
Digital Judgment Method: isNaN () function
The test () method determines whether the string matches the contents of the regular expression, and returns a Boolean value (True/false)
Verify that the Chinese name
function ischinaname (name)
{var pattern =/^[\u4e00-\u9fa5]{1,6}$/;
return pattern.test (name);
//Verify the mobile number
function Isphoneno (p
PHP Extract the birthday date in the ID number and verify whether it is an adult function, ID number adult
PHP extracts the birthday date from the ID number and determines whether a function is adult. Can be determined at the same time 15-bit and 18-bit ID card, by my pro-test, very useful, share the function code as
1, verify whether it is a Chinese characterVerify that the nickname private Boolean verifynickname () {String nickname = Edt_username.gettext (). toString (); if (nickname = = NULL | | nickname.length () = = 0) {Edt_username.seterror ("cannot be empty"); return false; } int len = 0; char[] Nickchar = Nickname.tochararray (); for (int i = 0; i 2. Verify the phone
Verify the number by using the JS regular expression.
Regular Expression set for verifying numbers
Verification number: ^ [0-9] * $
Verify the n-digit number: ^ \ d {n} $
Verify at least n digits: ^ \ d {n,} $
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.