Some SIM cards are not preset with the VoiceMail number at the factory, but the operator requires that the preset VM number be read from the mobile phone according to PLMN. This section describes how to preset VM number in xml format and how to allow users to modify and remember their choices. The priority of VM
Some SIM cards do not have a preset voicemail number at the factory, but the operator also requires the ability to adaptively read the preset VM number from the phone according to PLMN. This article describes how to preset VM number in XML, and how to allow users to modify and remember the user's choices. VM
[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.WriteLi
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
Determine if the Java file name is correct, and determine if the mailbox format is correct Function: Determine whether the Java file name is correct, and determine whether the mailbox format is correct. Where: The legal file name should end with. Java; legal mailbox namein at least include "@" and require "@" before ".". Practice Code:public class Test {public s
} theLbemail.text =""; + #endregion - the //Assign ValueBayiUserInfo user =NewUserInfo (); theUser. Address =Txtaddress.text; theUser. Email =Txtemail.text; -User. Mobile =Txtmobile.text; -User. PWD = Encryptpwd.encryptpassword (Txtpwd.text + encryptpwd.getpwdsalt ());//(password + password salt) before encryption theUser. UserName =txtUsername.Text; theUser. Gender = rdomale.checked?1:2;//RDO must have limited and only one selected the BOOLFlag
Oneself to the regular verification also did not have the system to use, this time oneself makes a demo, all of a sudden put these all use, next time need to come directly to take.
The following code is validated in the page using jquery, but also in the background to verify that you can try, the same principle.
Directly on the code: note: (Some of the validation rules of course not only this article, perhaps there are other better, you can message exchange)
Mobile phone
Let's take a look at the match usage in jquery.
String.match (Regular)
It looks the same as JS.
The regular rules for the phone number and the email we'll see.
Cell phone number Regular: ^ (((13[0-9]{1}) |159|153) +d{8})
Email address Regular: w+ (-w+) | (. w+)) *@[a-za-z0-9]+ ((. | -) [a-za-z0-9]+] *. [A-za-z0-9]
Now let's look at an example
The code is as follows
Copy Code
Class Regexconst { Const REGEX_MOBLIE_86 = '/^1 (3|4|5|7|8) \d{9}$/';//China Mobile number Const REGEX_MOBLIE_852 = '/^ (5|6|9) \d{7}$/';//HONG Kong mobile phone number Const REGEX_MOBLIE_1 = '/^\d{10}$/';//US mobile phone number Const regex_moblie_0039 = '/^\d{10}$/';//Italy mobile number Const REGEX_MO
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.