{"id":413,"date":"2017-02-06T10:23:41","date_gmt":"2017-02-06T02:23:41","guid":{"rendered":"http:\/\/www.rainweb.site\/?p=413"},"modified":"2023-08-07T20:57:30","modified_gmt":"2023-08-07T12:57:30","slug":"java-article28","status":"publish","type":"post","link":"http:\/\/rain1024.com\/index.php\/2017\/02\/06\/java-article28\/","title":{"rendered":"Java\u5224\u65ad\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u5b58\u5728\u6c49\u5b57"},"content":{"rendered":"<h3>Java\u5bf9\u6c49\u5b57\u7684\u652f\u6301\u8fd8\u662f\u5f88\u597d\u7684\uff08\u597d\u50cf\u9664\u4e86python\uff0c\u5176\u4ed6\u90fd\u633a\u597d\uff09\uff0c\u8fd9\u6b21\u5206\u4eab\u4e00\u6bb5\u5173\u4e8e\u5982\u4f55\u5224\u65ad\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u6709\u6c49\u5b57\u7684\u4ee3\u7801\u3002<\/h3>\n<pre><code class=\"java\">package com.rain.demo;\n\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\npublic class validate_haven {\n    public static void main(String[] args) {\n        String string = \"\u4e2d\u56fd\";\n        boolean result = isHave_validate(string);\n        System.out.println(result);\n    }\n    public static boolean isHave_validate(String str) {\n        boolean flag = true;\n        int count = 0;\n        String regEx = \"[\\\\u4e00-\\\\u9fa5]\";\n        Pattern p = Pattern.compile(regEx);\n        Matcher m = p.matcher(str);\n        while (m.find()) {\n            for (int i = 0; i &lt;= m.groupCount(); i++) {\n                count = count + 1;\n            }\n        }\n        if (count == 0) {\n            flag = false;\n        }\n        return flag;\n    }\n\n\n}\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Java\u5bf9\u6c49\u5b57\u7684\u652f\u6301\u8fd8\u662f\u5f88\u597d\u7684\uff08\u597d\u50cf\u9664\u4e86python\uff0c\u5176\u4ed6\u90fd\u633a\u597d\uff09\uff0c\u8fd9\u6b21\u5206\u4eab\u4e00\u6bb5\u5173\u4e8e\u5982\u4f55\u5224\u65ad\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u6709\u6c49\u5b57\u2026 <span class=\"read-more\"><a href=\"http:\/\/rain1024.com\/index.php\/2017\/02\/06\/java-article28\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[31],"tags":[46,85],"class_list":["post-413","post","type-post","status-publish","format-aside","has-post-thumbnail","hentry","category-java","tag-java","tag-code","post_format-post-format-aside"],"_links":{"self":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/comments?post=413"}],"version-history":[{"count":1,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"predecessor-version":[{"id":1512,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/posts\/413\/revisions\/1512"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media\/224"}],"wp:attachment":[{"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/media?parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rain1024.com\/index.php\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}