转型产品

走进需求
posts - 0, comments - 0, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Java Regex Compile

Posted on 2014-09-12 16:56 mrtom 阅读(80) 评论(0)  编辑  收藏
public static ArrayList<String> regexPattenArray(String regex,String content)
    {
        String cont = content;
        ArrayList<String> arrs = new ArrayList<String>();
        
        if(regex != null && cont != null)
        {            
            Matcher mat = Pattern.compile(regex).matcher(content);
            
            while(mat.find())
            {
                cont = mat.group();
                arrs.add(cont);
            }
        }
        
        return arrs;
    }

只有注册用户登录后才能发表评论。


网站导航: