java实现从报文中获取投保单号
投保单号正则表达式:
String regex = "([0-9]+) [\\s\\S]*([0-9]+) ";String [] arry = matchObject(regex, responseXml); public static String [] matchObject(final String regex,final String xml){ Listarray = new ArrayList (); Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(xml); if(matcher.find()){ int countX = matcher.groupCount(); for(int i=1;i<=countX;i++){ array.add(matcher.group(i)); } } return array.toArray(new String[array.size()]);}-----------------------------------------