public class PatternPool extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
BIRTHDAY
生日
|
static Pattern |
CHINESE
单个中文汉字
|
static Pattern |
CHINESES
中文汉字
|
static Pattern |
CITIZEN_ID
18位身份证号码
|
static Pattern |
CREDIT_CODE
社会统一信用代码
|
static Pattern |
EMAIL
邮件,符合RFC 5322规范,正则来自:http://emailregex.com/
|
static Pattern |
GENERAL
英文字母 、数字和下划线
|
static Pattern |
GENERAL_WITH_CHINESE
中文字、英文字母、数字和下划线
|
static Pattern |
GROUP_VAR
分组
|
static Pattern |
HEX
16进制字符串
|
static Pattern |
IPV4
IP v4
|
static Pattern |
IPV6
IP v6
|
static Pattern |
MAC_ADDRESS
MAC地址正则
|
static Pattern |
MOBILE
移动电话
|
static Pattern |
MONEY
货币
|
static Pattern |
NUMBERS
数字
|
static Pattern |
PLATE_NUMBER
中国车牌号码(兼容新能源车牌)
|
static Pattern |
TEL
座机号码
|
static Pattern |
TIME
时间正则
|
static Pattern |
URL
URL
|
static Pattern |
URL_HTTP
Http URL
|
static Pattern |
UUID
UUID
|
static Pattern |
UUID_SIMPLE
不带横线的UUID
|
static Pattern |
WORD
字母
|
static Pattern |
ZIP_CODE
邮编,兼容港澳台
|
Constructor and Description |
---|
PatternPool() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
清空缓存池
|
static Pattern |
get(String regex)
先从Pattern池中查找正则对应的
Pattern ,找不到则编译正则表达式并入池。 |
static Pattern |
get(String regex,
int flags)
先从Pattern池中查找正则对应的
Pattern ,找不到则编译正则表达式并入池。 |
static Pattern |
remove(String regex,
int flags)
移除缓存
|
public static final Pattern GENERAL
public static final Pattern NUMBERS
public static final Pattern WORD
public static final Pattern CHINESE
public static final Pattern CHINESES
public static final Pattern GROUP_VAR
public static final Pattern IPV4
public static final Pattern IPV6
public static final Pattern MONEY
public static final Pattern EMAIL
public static final Pattern MOBILE
public static final Pattern TEL
public static final Pattern CITIZEN_ID
public static final Pattern ZIP_CODE
public static final Pattern BIRTHDAY
public static final Pattern URL
public static final Pattern URL_HTTP
public static final Pattern GENERAL_WITH_CHINESE
public static final Pattern UUID
public static final Pattern UUID_SIMPLE
public static final Pattern MAC_ADDRESS
public static final Pattern HEX
public static final Pattern TIME
public static final Pattern PLATE_NUMBER
public static final Pattern CREDIT_CODE
第一部分:登记管理部门代码1位 (数字或大写英文字母) 第二部分:机构类别代码1位 (数字或大写英文字母) 第三部分:登记管理机关行政区划码6位 (数字) 第四部分:主体标识码(组织机构代码)9位 (数字或大写英文字母) 第五部分:校验码1位 (数字或大写英文字母)
public static Pattern get(String regex)
Pattern
,找不到则编译正则表达式并入池。regex
- 正则表达式Pattern
public static Pattern remove(String regex, int flags)
regex
- 正则flags
- 标识Pattern
,可能为null
public static void clear()
Copyright © 2021. All rights reserved.