android 快速使用正则表达式

快速使用:

    public String findNum(String path) {
        String str = path;//待匹配文本
        String reg = "/([0-9]{1,9})/com.*";//正则表达式
        Pattern p = Pattern.compile(reg);
        Matcher m = p.matcher(str);
        while (m.find()) {
            System.out.println(m.group(1));
            return m.group(1);
        }
    return "0";//异常返回0
    }

 

android 快速使用正则表达式

上一篇:ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ''. It's likely that neither a Result Type nor a Result Map was specified.


下一篇:Android 快速集成文档校正能力 超简单