Match phone number
Regex regphone = new Regex ("^[0-9]+[-]?[ 0-9]+[-]? [0-9]$ ");
Matching numbers
Regex regnumber = new Regex ("^[0-9]+$");
Match positive and negative integers
Regex regnumbersign = new Regex ("^[+-]?[ 0-9]+$ ");
Match decimal
Regex regdecimal = new Regex ("^[0-9]+[.]"? [0-9]+$ ");
Match positive and negative decimal
Regex regdecimalsign = new Regex ("^[+-]?[ 0-9]+[.]? [0-9]+$];//equivalent to ^[+-]?d+[.]? d+$
Match email address
A string of W-letters or numbers, as in [a-za-z0-9] syntax
Regex regemail = new Regex ("^[\w-]+@[\w-]+\." Com|net|org|edu|mil|tv|biz|info) $ ");
Match Chinese
Regex regchzn = new Regex ("[U4e00-u9fa5]");
Only numbers can be entered: "^[0-9]*$".
Only n digits can be entered: "^d{n}$".
You can enter at least n digits: "^d{n,}$".
You can enter only the number of m~n digits:. "^d{m,n}$"
Only numbers beginning with 0 and not 0 can be entered: ^ (0|[ 1-9][0-9]*) $ ".
You can only enter positive real numbers with two decimal digits: ^[0-9]+ (. [ 0-9]{2})? $ ".
You can only enter positive real numbers with 1~3 decimal places: ^[0-9]+ (. [ 0-9]{1,3})? $ ".
You can only enter a Non-zero positive integer: "^+?" [1-9] [0-9]*$].
You can only enter a Non-zero negative integer: "^-[1-9][]0-9" *$.
You can only enter characters with a length of 3: "^. {3}$ ".
You can only enter a string of 26 English letters: "^[a-za-z]+$".
You can only enter a string consisting of 26 uppercase letters: "^[a-z]+$".
You can only enter a string consisting of 26 lowercase English letters: "^[a-z]+$".
You can only enter a string consisting of numbers and 26 English letters: "^[a-za-z0-9]+$".
You can only enter a string of numbers, 26 English letters, or underscores: "^w+$".
Verify user password: "^[a-za-z]w{5,17}$" is the correct format: start with a letter, length between 6~18, can only contain characters, numbers, and underscores.
Verify that there are ^%& ',; =?$ ' characters: "[^%&",; = $x 22]+ ".
Verify ID Number (15-bit or 18-digit): "^d{15}|d{18}$".
Verify 12 months of the year: "^" (0?[ 1-9]|1[0-2]) $ "The correct format is:" 01 "~" 09 "and" 1 "~" 12 ".
Verify one months of 31 days: "^ (0?[ 1-9]) | ((1|2) [0-9]) |30|31) $ "correct format for;" 01 "~" 09 "and" 1 "~" 31 ".