Hide sensitive information such as mobile phone number and email address, and hide mobile phone number and email addressHiding sensitive information such as mobile phone numbers and mai
In some scenarios we may need to generate some random data, such as generating phone numbers, e-mail addresses and other data in a test environment for functional testing. Or import the production data into the test environment for simple desensitization processing. This is what I developed on the basis of dbms_random to generate:
Mobile phone number
The following lists various forms of verification functions that are commonly used in development, including email, phone, ip, website, date, ID card, etc.
# Region verified email address
/** // /// Verify the email address/// /// /// Public static bool IsEmail (string source){Return Regex. IsMatch (source, @ "^ [A-Z
Verify IP Address, login account, password, EMAIL, phone number [including cell phone and landline phone
var patterns = new Object ();
var Thepat;
var r, re;
Patterns.ip =/^ (d{1,2}|1dd|2[0-4]d|25[0-5]) (. ( D{1,2}|1DD|2[0-4]D|25[0-5])) {3}$/g;
Patterns.id =/^[a-za-z0
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 number, starting with 1.
Funct
The code is as follows:Copy code // Verify the mobile phone number$ Match = '/^ (13 [0-9]) | (15 [^ 4, \ d]) | (18 [0, 5-9]) [0-9] {8} $ /';// Verify the landline$ Match = '/^ (0 [0-9] {2, 3 }-)? ([2-9] [0-9] {6, 7}) + (-[0-9] {1, 4 })? $ /';// Verify the ID card number of 15 or 18 digits$ Match = '/(^ d {15} $) | (^ d {17} (d | X | x) $ )/
[Code Note] verifies the mobile phone number, email address, license plate number, and license plate number.
I. Code.
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. NSLog (@ "------ % d ------", [self isValidateEmail: @ "12345"])
The design defect of a station in the travel network of qinglv leads to a large amount of sensitive information leakage (Order/member number/name/mobile phone number/ID card number/email/address)
Qinglv Holdings Co., Ltd. (hereinafter referred to as qinglv) is a subsidiary o
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 number
I remember how much I dumped mail.139.com when it was launched. I could use my mobile phone number as my mailbox name. Since then, I no longer have to explain how my name is spelled out on the phone, how to tell others with caution, without a back-nose sound, or without a tongue roll; to apply for an email to their par
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
Verify the email core code as follows
The code is as follows
Copy Code
function Isemail (input) {var reg =/^w+ (-w+) | (. w+)) *@[a-za-z0-9]+ ((. | -) [a-za-z0-9]+] *. [a-za-z]+$/;return reg.test (input);} Cases
Verify the phone number
The code is as follows
Copy Code
function IsMobile (input) {
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.