Json extracted parameter values in a string format

Directly on the code:



the while (matcher.find ()) { System.out.println (Matcher.group (. 1)); } String the parse = "[{CSTM_NO: \" 11118 \ ", CSTM_NAME: \" Power Co. Guangdong XX \ ", FIX_GNL: \ "111 810 158 \", FIX_ACC: \ "D201306070003 \", "+ " OP_FLAG: \ "normal \", BUSS_KIND_NAME: \ "three-month term deposits \", BAL: \ "25,178,750.00 \", AVAL_BAL: \ "25,178,750.00 \", "+ " OP_DATE: \ "2013-06-07 \", DUE_DATE: \ "2013-12-07 \", ROWNUM_:. 1, IDX: 0}, {CSTM_NO: \ "11118 \", "+ " CSTM_NAME: \ "Guangdong electric power Co., XX \", FIX_GNL: \ "111810158 \", FIX_ACC: \ "D201306070002 \", OP_FLAG: \ " normal \", "+"+ " BUSS_KIND_NAME: \ "three-month term deposits \", BAL: \ "25,178,750.00 \", AVAL_BAL: \ "25,178,750.00 \", OP_DATE: \ "2013-06-07 \", "+ "DUE_DATE: \" 2013-12-07 \ " , ROWNUM_: 3, idx: 2}, {CSTM_NO: \" 11118 \ ", CSTM_NAME: \" Power Co. Guangdong XX \ "," + "FIX_GNL: \" 111810158 \ " , FIX_ACC: \" D201306070005 \ ", OP_FLAG: \" normal \ ", BUSS_KIND_NAME: \" three-month term deposits \ "," + "BAL: \" 25,178,750.00 \ ", AVAL_BAL: \ "25,178,750.00 \", OP_DATE: \ "2013-06-07 \", DUE_DATE: \ "2013-12-07 \", "+ " ROWNUM_:. 4, IDX:. 3}] "; String REGEX =" FIX_ACC: (.? *), OP_FLAG " ; // Do not forget to use non-greedy mode! = Matcher1 of Pattern.compile Matcher (REGEX) .matcher (the parse); the while (matcher1.find ()) { String matcher1.group RET = (. 1); System.out.println (RET); } String STR = "I [001] really help the [002], can you help me "; Pattern pattern1 = Pattern.compile ("

while(matcher2.find()){ System.out.println(matcher2.group(1)); } } }
Print results are as follows:
 
({"code":"200","json":["111","222","333"],"message":"true"})
111","222","333
"D201306070003"
"D201306070002"
"D201306070005"
001
002

Process finished with exit code 0
 

  



Guess you like

Origin www.cnblogs.com/ysq0908/p/11574833.html