re = /\"Id\":"(\d+)","LocalTime":"(\d+)"/m
str = '2020-06-05 01:00:33.919 INFO [Thread-261246][HClient.java:256] - post successefully
2020-06-05 01:00:33.920 INFO [Thread-261246][HClient.java:257] - {"ResponseStatusListObject":{"ResponseStatusObject":[{"RequestURL":"/VIID/Faces","StatusCode":"0","StatusMessage":"正常","Id":"31010713011328005232","LocalTime":"20200605005843"}]}}
2020-06-05 01:00:33.920 INFO [Thread-261246][PutuoHandle.java:104] - list send end, listSize:6, sendTime:757ms
2020-06-05 01:00:34.160 INFO [Thread-261248][HClient.java:256] - post successefully
2020-06-05 01:00:34.160 INFO [Thread-261248][HClient.java:257] - {"ResponseStatusListObject":{"ResponseStatusObject":[{"RequestURL":"/VIID/Faces","StatusCode":"0","StatusMessage":"正常","Id":"31010712011328005082","LocalTime":"20200605010212"}]}}
2020-06-05 01:00:34.196 INFO [Thread-261247][HClient.java:256] - post successefully
2020-06-05 01:00:34.196 INFO [Thread-261247][HClient.java:257] - {"ResponseStatusListObject":{"ResponseStatusObject":[{"RequestURL":"/VIID/Faces","StatusCode":"0","StatusMessage":"正常","Id":"31010712011328005082","LocalTime":"20200605010240"}]}}
2020-06-05 01:00:34.196 INFO [Thread-261247][PutuoHandle.java:104] - list send end, listSize:5, sendTime:954ms
2020-06-05 01:00:34.323 INFO [Thread-261248][HClient.java:256] - post successefully
2020-06-05 01:00:34.323 INFO [Thread-261248][HClient.java:257] - {"ResponseStatusListObject":{"ResponseStatusObject":[{"RequestURL":"/VIID/Faces","StatusCode":"0","StatusMessage":"正常","Id":"31010713011328005232","LocalTime":"20200605005843"}]}}
2020-06-05 01:00:34.510 INFO [Thread-261248][HClient.java:256] - post successefully
2020-06-05 01:00:34.510 INFO [Thread-261248][HClient.java:257] - {"ResponseStatusListObject":{"ResponseStatusObject":[{"RequestURL":"/VIID/Faces","StatusCode":"0","StatusMessage":"正常","Id":"31010711011328005078","LocalTime":"20200605010240"}]}}
2020-06-05 01:00:34.510 INFO [Thread-261248][PutuoHandle.java:104] - list send end, listSize:5, sendTime:1464ms
2020-06-05 01:00:48.939 INFO [Timer-0][PutuoHandleThread.java:29] - area=>PT_AREA cameraType=>HK_TP groupCount=>3
2020-06-05 01:00:48.939 INFO [Timer-0][DbUtil.java:118] - getLastMaxId, cameraType:HK_TP, area:PT_AREA
2020-06-05 01:00:48.940 INFO [Timer-0][DbUtil.java:129] - sql=SELECT maxid FROM t_flag_info WHERE cameraType = ? AND area = ?, 1:HK_TP, 2:PT_AREA'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html