java - Filtered out sucess_entries String -


can suggest me string "success entries , failed entries: {failed_entries={}, success_entries={123=1509180522720153332, 124=1509181140480153332}}".

here want filter-out 2 strings 1509180522720153332 , 1509181140480153332.can suggest me ?

you can regex

string str = "success entries , 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()); } 

but remember regex lookbehind/lookahead not in performance


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -