17 types of regular expressions in ASP.NET
Author:Eve Cole
Update Time:2009-06-30 15:49:52
"^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+)?$" //Non-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 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 consisting of 26 English letters
"^[AZ]+$" //A string consisting of 26 uppercase English letters
"^[az]+$" //A string consisting of 26 lowercase English letters
"^[A-Za-z0-9]+$" //A string consisting of numbers and 26 English letters
"^w+$" //A string consisting of numbers, 26 English letters or underscores
"^[w-]+(.[w-]+)*@[w-]+(.[w-]+)+$" //email address
"^[a-zA-z]+://(w+(-w+)*)(.(w+(-w+)*))*(?S*)?$" // url