/*tpa=http://21.20.1.2/gup/soion/appn/*/就头和尾是固定的
头:/*tpa=http尾:*/请指教!

解决方案 »

  1.   

    public static void main(String[] args) {
      String str= "/*tpa=http://21.20.1.2/gup/soion/appn/*/";
      String regex = "/\\*tpa=http:(.*?)\\*/";
      Pattern p = Pattern.compile(regex);
      Matcher m = p.matcher(str);
      if (m.find()){
        System.out.println(m.group(1));
      }
    }
      

  2.   

    如果数据多,可以把if换成while
      

  3.   

    看偶的
    var re = new RegExp(""/\\*tpa=http:(.*?)\\*/";","ig");
    var a = str.match(re);
    for ( i=0; i<a.length; i++) {
    alert(a[i]);
    }