截取html中的某个节点

String content = "<meta property="og:description" content="freeCodeCamp Earth &#x6709; 127,712 &#x4f4d;&#x6210;&#x54e1;&#x3002; Welcome to freeCodeCamp Earth!
" +
                "
" +
                "This is a relaxing place to discuss coding and share your accomplishments.
" +
                "
" +
                "To keep this Facebook group civil, our moderator team..." />
" +
                "	<meta property="og:url" content="https://www.facebook.com/groups/321090721625587/" />
" +
                "	<meta property="og:locale" content="en_US" />";
        String readText = "";
//        Pattern p = Pattern.compile("<div\s*class=["']mail-trace["'](.*)>(.*)<\/div>");
        Pattern p = Pattern.compile("<meta\s*property=["']og:url["'](.*)(.*)\/>");
        Matcher matcher = p.matcher(content);
        if (matcher.find()) {
            for (int i = 0; i <= matcher.groupCount() && StringUtils.isEmpty(readText); i++) {
                readText += matcher.group(i);
            }
        }
        System.out.println(readText);
<meta property="og:description" content="freeCodeCamp Earth &#x6709; 127,712 &#x4f4d;&#x6210;&#x54e1;&#x3002; Welcome to freeCodeCamp Earth!

This is a relaxing place to discuss coding and share your accomplishments.

To keep this Facebook group civil, our moderator team..." />
    <meta property="og:url" content="https://www.facebook.com/groups/321090721625587/" />     要匹配内容!
    <meta property="og:locale" content="en_US" />
原文地址:https://www.cnblogs.com/wanhua-wu/p/13638366.html