[ 來(lái)源:動(dòng)網(wǎng) |作者:佚名 ]
"^\\d+$" //非負(fù)整數(shù)(正整數(shù) + 0) "^[0-9]*[1-9][0-9]*$" //正整數(shù) "^((-\\d+)|(0+))$" //非正整數(shù)(負(fù)整數(shù) + 0) "^-[0-9]*[1-9][0-9]*$" //負(fù)整數(shù) "^-?\\d+$" //整數(shù) "^\\d+(\\.\\d+)?$" //非負(fù)浮點(diǎn)數(shù)(正浮點(diǎn)數(shù) + 0) "^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$" //正浮點(diǎn)數(shù) "^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$" //非正浮點(diǎn)數(shù)(負(fù)浮點(diǎn)數(shù) + 0) "^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$" //負(fù)浮點(diǎn)數(shù) "^(-?\\d+)(\\.\\d+)?$" //浮點(diǎn)數(shù) "^[A-Za-z]+$" //由26個(gè)英文字母組成的字符串 "^[A-Z]+$" //由26個(gè)英文字母的大寫(xiě)組成的字符串 "^[a-z]+$" //由26個(gè)英文字母的小寫(xiě)組成的字符串 "^[A-Za-z0-9]+$" //由數(shù)字和26個(gè)英文字母組成的字符串 "^\\w+$" //由數(shù)字、26個(gè)英文字母或者下劃線組成的字符串 "^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$" //email地址 "^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$" //url
來(lái)源:http://edu.chinaz.com