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;
     }
相关文章
相关标签/搜索