17种正则表达式


"^\\d+contentquot; //非负整数(正整数 + 0)
"^[0-9]*[1-9][0-9]*contentquot; //正整数
"^((-\\d+)|(0+))contentquot; //非正整数(负整数 + 0)
"^-[0-9]*[1-9][0-9]*contentquot; //负整数
"^-?\\d+contentquot; //整数
"^\\d+(\\.\\d+)?contentquot; //非负浮点数(正浮点数 + 0)
"^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))contentquot; //正浮点数
"^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))contentquot; //非正浮点数(负浮点数 + 0)
"^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))contentquot; //负浮点数
"^(-?\\d+)(\\.\\d+)?contentquot; //浮点数
"^[A-Za-z]+contentquot; //由26个英文字母组成的字符串
"^[A-Z]+contentquot; //由26个英文字母的大写组成的字符串
"^[a-z]+contentquot; //由26个英文字母的小写组成的字符串
"^[A-Za-z0-9]+contentquot; //由数字和26个英文字母组成的字符串
"^\\w+contentquot; //由数字、26个英文字母或者下划线组成的字符串
"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+contentquot; //email地址
"^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?contentquot; //url
Copyright © 2008 qcode.org All Rights Reserved 编程开发 由朝夕网络维护