public class FormatValidateUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
AGE
年龄正则表达式 ^(?
|
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正则表达式;
|
static String |
INTEGER
Integer正则表达式 ^-?
|
static String |
INTEGER_NEGATIVE
正整数正则表达式 >=0 ^[1-9]\d*|0$
|
static String |
INTEGER_POSITIVE
负整数正则表达式 <=0 ^-[1-9]\d*|0$
|
static String |
MOBILE
手机号码正则表达式
|
static String |
PHONE
电话号码正则表达式
|
static String |
STR_ENG
匹配由26个英文字母组成的字符串 ^[A-Za-z]+$
|
static String |
URL
URL正则表达式
匹配 http www ftp
|
static String |
ZIP_CODE
邮编正则表达式 [0-9]\d{5}(?!
|
| 构造器和说明 |
|---|
FormatValidateUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isAge(String str)
判断字段是否为年龄 符合返回ture
|
static boolean |
isDate(String str)
判断字段是否为日期 符合返回ture
|
static boolean |
isDouble(String str)
判断字段是否为DOUBLE 符合返回ture
|
static boolean |
isEmail(String str)
判断字段是否为Email 符合返回ture
|
static boolean |
isEnglish(String str)
判断字符串是不是全部是英文字母
|
static boolean |
isIdCard(String str)
判断字段是否为身份证 符合返回ture
|
static boolean |
isInteger(String str)
判断字段是否为INTEGER 符合返回ture
|
static boolean |
isMobile(String str)
判断是否为手机号码 符合返回ture
|
static boolean |
isNegativeDouble(String str)
判断字段是否为正浮点数正则表达式 >=0 符合返回ture
|
static boolean |
isNegativeInteger(String str)
判断字段是否为正整数正则表达式 >=0 符合返回ture
|
static boolean |
isNumber(String str)
判断字符串是不是数字组成
|
static boolean |
isPhone(String str)
判断是否为电话号码 符合返回ture
|
static boolean |
isPositiveDouble(String str)
判断字段是否为负浮点数正则表达式 <=0 符合返回ture
|
static boolean |
isPositiveInteger(String str)
判断字段是否为负整数正则表达式 <=0 符合返回ture
|
static boolean |
isUrl(String str)
判断是否为Url 符合返回ture
|
static boolean |
isZipCode(String str)
判断字段是否为邮编 符合返回ture
|
static void |
main(String[] args) |
public static final String DOUBLE
public static final String DOUBLE_NEGATIVE
public static final String DOUBLE_POSITIVE
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 isInteger(String str)
str - public static boolean isNegativeInteger(String str)
str - public static boolean isPositiveInteger(String str)
str - public static boolean isDouble(String str)
str - public static boolean isNegativeDouble(String str)
str - public static boolean isPositiveDouble(String str)
str - public static boolean isDate(String str)
str - public static boolean isAge(String str)
str - public static boolean isIdCard(String str)
str - public static boolean isZipCode(String str)
str - public static boolean isEnglish(String str)
str - public static boolean isNumber(String str)
str - public static void main(String[] args)
Copyright © 2025. All rights reserved.