{"id":13028,"date":"2025-03-17T11:17:51","date_gmt":"2025-03-17T03:17:51","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=13028"},"modified":"2025-03-17T11:19:06","modified_gmt":"2025-03-17T03:19:06","slug":"gbase-8a%e9%9b%86%e7%be%a4%e6%9f%a5%e8%af%a2%e6%98%af%e5%90%a6%e5%8c%85%e5%90%ab%e6%b1%89%e5%ad%97%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/13028","title":{"rendered":"GBase 8a\u96c6\u7fa4\u67e5\u8be2\u662f\u5426\u5305\u542b\u6c49\u5b57\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a\u96c6\u7fa4\uff0c\u901a\u8fc7REGEXP\u68c0\u6d4b\u662f\u5426\u5305\u542b\u6c49\u5b57\u7684\u65b9\u6cd5\uff0c\u4ec5\u9650\u4e8eUTF8mb4\u5b57\u7b26\u96c6\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2a94211358f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2a94211358f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/13028\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/13028\/#%E6%A3%80%E6%B5%8B%E6%96%B9%E6%B3%95\" >\u68c0\u6d4b\u65b9\u6cd5<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83\"><\/span>\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; select * from tc;\n+--------------+\n| name         |\n+--------------+\n| First        |\n| \u5357\u5927\u901a\u7528     |\n| 123          |\n| AAAA         |\n| \u4e2d\u56fd         |\n| \u6c49           |\n| 666\u4e2d\u56fd888   |\n+--------------+\n7 rows in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A3%80%E6%B5%8B%E6%96%B9%E6%B3%95\"><\/span>\u68c0\u6d4b\u65b9\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5982\u4e0b2\u79cd\u5747\u53ef\u3002<\/p>\n\n\n\n<p>\u5176\u4e2d\u7b2c\u4e8c\u79cd\uff0c\u76f4\u63a5\u5728SQL\u91cc\u8f93\u5165\u7684\u4e2d\u6587\uff0c\u8981\u8003\u8651\u5230\u5b57\u7b26\u96c6\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u79cd\u5219\u76f4\u63a5\u7528\u7684UTF8mb4\u7f16\u7801\uff0c\u5176\u4e2d\u5305\u62ec\u548c\u4e2d\u62ec\u53f7\u548c\u4e24\u4e2a\u6c49\u5b57\u4e4b\u95f4\u7684\u6a2a\u6760\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; select * from testdb.tc where name REGEXP unhex('5be4b8802de9bea55d');\n+--------------+\n| name         |\n+--------------+\n| \u5357\u5927\u901a\u7528     |\n| \u4e2d\u56fd         |\n| \u6c49           |\n| 666\u4e2d\u56fd888   |\n+--------------+\n4 rows in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from tc where name REGEXP '&#91;\u4e00-\u9fa5]';\n+--------------+\n| name         |\n+--------------+\n| \u5357\u5927\u901a\u7528     |\n| \u4e2d\u56fd         |\n| \u6c49           |\n| 666\u4e2d\u56fd888   |\n+--------------+\n4 rows in set (Elapsed: 00:00:00.00)\n\n<\/code><\/pre>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a\u96c6\u7fa4\uff0c\u901a\u8fc7REGEXP\u68c0\u6d4b\u662f\u5426\u5305\u542b\u6c49\u5b57\u7684\u65b9\u6cd5\uff0c\u4ec5\u9650\u4e8eUTF8mb4\u5b57\u7b26\u96c6\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-13028","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=13028"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13028\/revisions"}],"predecessor-version":[{"id":13030,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/13028\/revisions\/13030"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=13028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=13028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=13028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}