zoukankan      html  css  js  c++  java
  • java实现从报文中获取投保单号

    java实现从报文中获取投保单号

    投保单号正则表达式:

    String regex = "<proposalNo>([0-9]+)</proposalNo>[\s\S]*<proposalNo>([0-9]+)</proposalNo>";
    
    String [] arry = matchObject(regex, responseXml);
    
     
    
    
    public static String [] matchObject(final String regex,final String xml){
      List<String> array = new ArrayList<String>();
      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()]);
    }
    -----------------------------------------
  • 相关阅读:
    ajax的调用
    jqurey的应用
    php数据访问数据层
    php租房子练习
    php投票
    Thinkphp 控制器
    ThinkPHP 框架基础
    php留言板
    php上传文件及头像预览
    php文件操作
  • 原文地址:https://www.cnblogs.com/liuyitan/p/6866989.html
Copyright © 2011-2022 走看看