Java 筛选出sucess_条目字符串
你能为我推荐这个字符串“成功条目和失败条目:{Failed_Entries={},Success_Entries={123=1509180522720153332,124=1509181140480153332}”Java 筛选出sucess_条目字符串,java,pattern-matching,Java,Pattern Matching,你能为我推荐这个字符串“成功条目和失败条目:{Failed_Entries={},Success_Entries={123=1509180522720153332,124=1509181140480153332}” 在这里,我想过滤掉两个字符串1509180522720153332和1509181140480153332。有人能推荐我吗?你可以用regex来做 String str = "Success Entries and Failed Entries: {FAILED_ENTRIES={}
在这里,我想过滤掉两个字符串1509180522720153332和1509181140480153332。有人能推荐我吗?你可以用regex来做
String str = "Success Entries and Failed Entries: {FAILED_ENTRIES={}, SUCCESS_ENTRIES={123=1509180522720153332, 124=1509181140480153332}}";
Matcher matcher = Pattern.compile("(?<=(SUCCESS_ENTRIES=\\{)).+?(?=\\})").matcher(str);
matcher.find();
str = matcher.group();
System.out.println(str);
matcher = Pattern.compile("(?<=\\d{3}=)\\d+").matcher(str);
while(matcher.find()){
System.out.println(matcher.group());
}
String str=“成功条目和失败条目:{Failed_Entries={},Success_Entries={123=1509180522720153332,124=1509181140480153332}”;
Matcher Matcher=Pattern.compile(“(?)?