public class FormatValidateUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
AGE
年龄正则表达式 ^(?
|
static String |
CODE
邮编正则表达式 [0-9]\d{5}(?!
|
static String |
DATE_ALL
日期正则 支持:
YYYY-MM-DD
YYYY/MM/DD
YYYY_MM_DD
YYYYMMDD
YYYY.MM.DD的形式
|
static String |
DATE_FORMAT1
日期正则 支持:
YYYY-MM-DD
|
static String |
DOUBLE
Double正则表达式 ^-?
|
static String |
DOUBLE_NEGATIVE
正Double正则表达式 >=0 ^[1-9]\d*\.
|
static String |
DOUBLE_POSITIVE
负Double正则表达式 <= 0 ^(-([1-9]\d*\.
|
static String |
EMAIL
Email正则表达式="^([a-z0-9A-Z]+[-|\\.]?)
|
static String |
IDCARD
身份证正则表达式
|
static String |
INTEGER
Integer正则表达式 ^-?
|
static String |
INTEGER_NEGATIVE
正整数正则表达式 >=0 ^[1-9]\d*|0$
|
static String |
INTEGER_POSITIVE
负整数正则表达式 <=0 ^-[1-9]\d*|0$
|
static String |
JIGOU_CODE
机构代码
|
static String |
MOBILE
手机号码正则表达式=^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$
|
static String |
PHONE
电话号码正则表达式= (^(\d{2,4}[-_-—]?)?
|
static String |
STR_ENG
匹配由26个英文字母组成的字符串 ^[A-Za-z]+$
|
static String |
STR_ENG_NUM
匹配由数字和26个英文字母组成的字符串 ^[A-Za-z0-9]+$
|
static String |
STR_ENG_NUM_
匹配由数字、26个英文字母或者下划线组成的字符串 ^\w+$
|
static String |
STR_NUM
匹配数字组成的字符串 ^[0-9]+$
|
static String |
STR_SPECIAL
过滤特殊字符串正则
regEx="[`~!
|
static String |
URL
URL正则表达式
匹配 http www ftp
|
| 构造器和说明 |
|---|
FormatValidateUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
filterStr(String str)
过滤特殊字符串 返回过滤后的字符串
|
static boolean |
isAge(String str)
判断字段是否为年龄 符合返回ture
|
static boolean |
isCode(String str)
判断字段是否为邮编 符合返回ture
|
static boolean |
isDate(String str)
判断字段是否为日期 符合返回ture
|
static boolean |
isDate1(String str)
验证2010-12-10
|
static boolean |
isDOUBLE_NEGATIVE(String str)
判断字段是否为正浮点数正则表达式 >=0 符合返回ture
|
static boolean |
isDOUBLE_POSITIVE(String str)
判断字段是否为负浮点数正则表达式 <=0 符合返回ture
|
static boolean |
isDouble(String str)
判断字段是否为DOUBLE 符合返回ture
|
static boolean |
isEmail(String str)
判断字段是否为Email 符合返回ture
|
static boolean |
isENG_NUM_(String str)
判断字符串是不是全部是英文字母+数字+下划线
|
static boolean |
isENG_NUM(String str)
判断字符串是不是全部是英文字母+数字
|
static boolean |
isEnglish(String str)
判断字符串是不是全部是英文字母
|
static boolean |
isIdCard(String str)
判断字段是否为身份证 符合返回ture
|
static boolean |
isINTEGER_NEGATIVE(String str)
判断字段是否为正整数正则表达式 >=0 符合返回ture
|
static boolean |
isINTEGER_POSITIVE(String str)
判断字段是否为负整数正则表达式 <=0 符合返回ture
|
static boolean |
isInteger(String str)
判断字段是否为INTEGER 符合返回ture
|
static boolean |
isJigouCode(String str)
校验机构代码格式
|
static boolean |
isLengOut(String str,
int leng)
判断字段是否超长
字串为空返回fasle, 超过长度{leng}返回ture 反之返回false
|
static boolean |
isMobile(String str)
判断是否为手机号码 符合返回ture
|
static boolean |
isNumber(String str)
判断字段是否为数字 正负整数 正负浮点数 符合返回ture
|
static boolean |
isPhone(String str)
判断是否为电话号码 符合返回ture
|
static boolean |
isSTR_NUM(String str)
判断字符串是不是数字组成
|
static boolean |
isUrl(String str)
判断是否为Url 符合返回ture
|
static String |
nulltoStr(String str)
字符串null转空
|
static String |
nulltoStr(String str,
String defaut)
字符串null赋值默认值
|
static boolean |
StrisNull(String str)
判断字段是否为空 符合返回ture
|
static boolean |
StrNotNull(String str)
判断字段是非空 符合返回ture
|
public static final String EMAIL
public static final String PHONE
public static final String MOBILE
public static final String DOUBLE
public static final String DOUBLE_NEGATIVE
public static final String DOUBLE_POSITIVE
public static final String STR_SPECIAL
public static final String DATE_ALL
public static boolean StrisNull(String str)
str - public static boolean StrNotNull(String str)
str - public static String nulltoStr(String str, String defaut)
str - 目标字符串defaut - 默认值public static boolean isEmail(String str)
str - public static boolean isPhone(String str)
str - public static boolean isMobile(String str)
str - public static boolean isUrl(String str)
str - public static boolean isNumber(String str)
str - public static boolean isInteger(String str)
str - public static boolean isINTEGER_NEGATIVE(String str)
str - public static boolean isINTEGER_POSITIVE(String str)
str - public static boolean isDouble(String str)
str - public static boolean isDOUBLE_NEGATIVE(String str)
str - public static boolean isDOUBLE_POSITIVE(String str)
str - public static boolean isDate(String str)
str - public static boolean isDate1(String str)
str - public static boolean isAge(String str)
str - public static boolean isLengOut(String str, int leng)
str - leng - public static boolean isIdCard(String str)
str - public static boolean isCode(String str)
str - public static boolean isEnglish(String str)
str - public static boolean isENG_NUM(String str)
str - public static boolean isENG_NUM_(String str)
str - public static boolean isJigouCode(String str)
public static boolean isSTR_NUM(String str)
str - Copyright © 2017. All rights reserved.