【修改参数正则解析逻辑】
This commit is contained in:
parent
26719b4685
commit
35b1287875
@ -102,9 +102,11 @@ public class VoiceParseServiceImpl implements VoiceParseService {
|
||||
private List<String> keyWordsMatch(String patternStr, String content) {
|
||||
List<String> groupList = new ArrayList<>();
|
||||
Pattern pattern = Pattern.compile(patternStr);// 匹配的模式
|
||||
Matcher m = pattern.matcher(content);
|
||||
if (m.find()) {
|
||||
groupList.add(m.group());
|
||||
Matcher matcher = pattern.matcher(content);
|
||||
if (matcher.find()) {
|
||||
for (int index = 1, size = matcher.groupCount(); index <= size; index++) {
|
||||
groupList.add(matcher.group(index));
|
||||
}
|
||||
}
|
||||
return groupList;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user