`
my_java_life
  • 浏览: 144277 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

解析html

阅读更多
Pattern aPattern = Pattern.compile(screenRegex, 2);
        Matcher aMat = aPattern.matcher(webContent);
        String result = null;
        if (!aMat.find())
        {
            return result;
        }
        result = aMat.group(1);

        String regexStart = "(<" + tag + ">)|(<" + tag + "\\s+[^<>/]*>)";
        String regexSEnd = "</" + tag + ">";
        int index = 0;
        int count = 0;
        String temp;

        Pattern aPattern3 = Pattern.compile(regexStart, 2);
        Matcher aMat3 = aPattern3.matcher(result);

        if (aMat3.find())
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics