public enum RegexType extends Enum<RegexType>
文件名:RegexType.java
用途: 枚举常用的正则表达式
编码时间:2020年8月17日下午5:47:33
修改时间:2023年5月17日 下午12:01:39
Enum Constant and Description |
---|
EMAIL
E-mail基本正则
|
FOLDER_PATH
文件夹基本正则
|
FORMAT_DATE_REGEX
判断文本是否为格式化日期的格式
|
INTEGER
判断文本是否为整数的正则
|
REGEX_ESC
正则表达式中的特殊符号(需要转义的符号,如“(”)
|
REGEX_REGEX
判断文本是否包含正则表达的正则
|
URL
url基本正则
|
Modifier and Type | Method and Description |
---|---|
String |
getRegex()
返回枚举对应的正则表达式
|
boolean |
judgeString(String content)
用于判断字符串是否符合当前枚举的正则表达式
|
static RegexType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RegexType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RegexType URL
public static final RegexType EMAIL
public static final RegexType FOLDER_PATH
public static final RegexType REGEX_ESC
public static final RegexType REGEX_REGEX
public static final RegexType INTEGER
public static final RegexType FORMAT_DATE_REGEX
public static RegexType[] values()
for (RegexType c : RegexType.values()) System.out.println(c);
public static RegexType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getRegex()
public boolean judgeString(String content)
content
- 待判断的字符串Copyright © 2024. All rights reserved.