Java正則表達式小例子

      

public static String findStringByRegex(String s){
       String regex = "\\d{7}";
         Pattern p = Pattern.compile(regex);
         Matcher m = p.matcher(s);
        if( m.find()){
         s =  m.group().toString();
        }
        return s;
     }
相關文章
相關標籤/搜索