【亿码酷站-编程开发教程】收集全网优质教程及源码资源!

全网优质软件开发、平面设计等教程及精品源码资源一站可得,www.ymkuzhan.com!

java正则表达式匹配字符串的方法:使用tostring,代码为【while(matcher.find()){tmp.add(matcher.group(1).toString());}】。

java正则表达式如何匹配字符串_亿码酷站_亿码酷站插图

java正则表达式匹配字符串的方法:

使用tostring

private static List<String> getImage(String str){
        List<String> tmp=new ArrayList<String>();
        String regex="<img src=\"([^\"]+?)\" />";
        Pattern pattern = Pattern.compile(regex);  
        Matcher matcher = pattern.matcher(str); 
        System.out.println(str);
        while(matcher.find()){
        
            tmp.add(matcher.group(1).toString());
            
        }
        return tmp;       
    }

java正则表达式如何匹配字符串
—–文章转载自PHP中文网如有侵权请联系admin#tyuanma.cn删除

mysql怎么查询今天的数据

云服务器推荐