"^\d+$"//non-negative Integer (positive integer + 0)
"^[0-9]*[1-9][0-9]*$"//Positive integer
"^ ((-\d+) | (0+)) $ "//non-positive integer (negative integer + 0)
"^-[0-9]*[1-9][0-9]*$"//Negative integer
"^-?\d+$"//Integer
"^\d+ (\.\d+)? $"//nonnegative floating-point number (positive float + 0)
"^ ([0-9]+\. [0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*\. [0-9]+) | ([0-9]*[1-9][0-9]*)] $ "//Positive floating-point number
"^ ((-\d+ (\.\d+)?) | (0+ (\.0+)) $ "//non-positive floating-point number (negative floating-point number + 0)
^ (-([0-9]+\. [0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*\. [0-9]+) | ([0-9]*[1-9][0-9]*))] $ "//negative floating-point
Number
"^ (-?\d+) (\.\d+)? $"//floating-point number
"^[a-za-z]+$"//A string of 26 English letters
"^[a-z]+$"//A string of 26 uppercase letters
"^[a-z]+$"///a string consisting of 26 lowercase letters
"^[a-za-z0-9]+$"//A string of numbers and 26 English letters
"^\w+$"//A string of numbers, 26 English letters, or underscores
"^[\w-]+ (\.[ \w-]+) *@[\w-]+ (\.[ \w-]+) +$ "//email address
"^[a-za-z]+://(\w+ (-\w+) *) (\. ( \w+ (-\w+) *)) * (\?\s*) $ "//url
/^13\d{9}$/gi cell phone number Regular expression
public static bool Isvalidmobileno (string Mobileno)
{
Const string Regpattern = @ "^ (130|131|132|133|134|135|136|137|138|139) \d{8}$";
Return Regex.IsMatch (Mobileno, Regpattern);
}
Regular expression--verification of mobile phone number: 13[0-9]{9}
To achieve the mobile phone number 86 or +86 before: ^ (\+86) | (86))? (\d{9}$)
The phone number and mobile number are verified simultaneously: (^ (\d{3,4}-) \d{7,8}) $| (13[0-9]{9})
To extract the network links in the information: (h| H) (r| R) (e| E) (f| F) *= * (' | ')? (\w|\\|\/|\.) +('|"| *|>)?
Message address in the extraction information: \w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *
Extract picture links in information: (s| S) (r| R) (c| C) *= * (' | ')? (\w|\\|\/|\.) +('|"| *|>)?
Extract the IP address in the information: (\d+) \. (\d+) \. (\d+) \. (\d+)
China Mobile phone number to extract information: (*0*13\D{9)
Extract Chinese fixed phone number in information: (\ (\d{3,4}\) |\d{3,4}-|\s)? \d{8}
Extract the Chinese phone number (including mobile and landline) in the information:(\ (\d{3,4}\) |\d{3,4}-|\s)? \d{7,14}
China Post Code in Extract information: [1-9]{1} (\d+) {5}
Chinese identity card number in the extraction of information: \d{18}|\d{15}
To extract an integer from the information: \d+
Extract floating-point numbers (that is, decimals) in the information: (-?\d*) \.? \d+
Extract any number in the information: (-?\d*) (\.\d+)?
Extract the Chinese string in the information: [\u4e00-\u9fa5]*
Extract a double-byte string (kanji) from the information: [^\x00-\xff]*
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.