public class RegularUtils extends Object
正则匹配相关工具
author : Crab2Died date : 2017/5/24 9:43| 构造器和说明 |
|---|
RegularUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
converNumByReg(String number) |
static boolean |
isMatched(String pattern,
String reg)
判断内容是否匹配
author : Crab2Died
date : 2017年06月02日 15:46:25
|
static String |
match(String pattern,
String reg)
正则提取匹配到的内容,默认提取索引为0
例如:
author : Crab2Died
date : 2017年06月02日 15:49:51
|
static List<String> |
match(String pattern,
String reg,
int group)
正则提取匹配到的内容
例如:
author : Crab2Died
date : 2017年06月02日 15:49:51
|
public static boolean isMatched(String pattern, String reg)
判断内容是否匹配
author : Crab2Died date : 2017年06月02日 15:46:25pattern - 匹配目标内容reg - 正则表达式public static List<String> match(String pattern, String reg, int group)
正则提取匹配到的内容
例如:
author : Crab2Died date : 2017年06月02日 15:49:51
pattern - 匹配目标内容reg - 正则表达式group - 提取内容索引public static String match(String pattern, String reg)
正则提取匹配到的内容,默认提取索引为0
例如:
author : Crab2Died date : 2017年06月02日 15:49:51
pattern - 匹配目标内容reg - 正则表达式Copyright © 2020. All rights reserved.