Home>

Regular expressions are widely used in program development.This article has shared 17 common regular expressions in asp.net,

"^/d + $" //Negative integer (positive integer + 0)

"^ [0-9] * [1-9] [0-9] * $" //Positive integer

"^ ((-/d +) (0 +)) $" //Negative integer (negative integer + 0)

"^-[0-9] * [1-9] [0-9] * $" //Negative integer

"^-?/d + $" //Integer

"^/d + (/./d +)?$" //Negative floating-point number (positive 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] *)) $"//Positive floating-point number

"^ ((-/d + (/./d +)?) (0 + (/. 0 +)?)) $" //Non-positive floating-point numbers (negative floating-point numbers + 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 +)?$" //Float

"^ [a-za-z] + $" //A string of 26 English letters

"^ [a-z] + $" //A string of 26 English capitals

"^ [a-z] + $" //a string 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

^ [a-za-z] [a-za-z0-9 _] {5,15} $//The regular expression for verifying the username,Must begin with a letter,Can only include letters/numbers/underscores, the total length must be 6-16 digits

^ [1-9] ([0-9] {16} | [0-9] {13}) [xx0-9] $//ID (15-18 digits, do not start with 0, you can end with x)

The above are the 17 commonly used regular expressions in asp.net that we introduce to you.Hope you like it.