public class RegexFactory extends Object
Constructor and Description |
---|
RegexFactory() |
Modifier and Type | Method and Description |
---|---|
static String |
extract(String regex,
String content)
根据正则表达式从内容中提取出一组匹配的内容
只要匹配到第一组数据就会返回 |
static List<String> |
extractAll(String regex,
String content)
根据正则表达式从内容中提取出所有匹配的内容
返回所有匹配的数据 |
static boolean |
find(String regex,
String content)
判断内容是否包正则表达式标识的内容
|
static boolean |
match(String regex,
String content)
判断内容是否符合正则表达式
|
static Pattern |
pattern(String regex)
根据正则表达式获取Pattern对象
|
public static boolean match(String regex, String content)
regex
- content
- public static boolean find(String regex, String content)
regex
- content
- public static String extract(String regex, String content)
regex
- 正则表达式content
- 目标内容Copyright © 2020 Pivotal Software, Inc.. All rights reserved.