{"id":41577,"date":"2024-01-12T04:39:43","date_gmt":"2023-12-26T05:00:46","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/"},"modified":"2024-05-04T17:59:52","modified_gmt":"2024-05-04T09:59:52","slug":"%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/","title":{"rendered":"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f"},"content":{"rendered":"<h1>\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26<\/h1>\n<p>PostgreSQL\u4e2d\u6709\u4e00\u4e2a\u79f0\u4e3a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26\u7684\u7279\u6027\u3002\u5b83\u53ef\u4ee5\u7528\u4e8e\u65e0\u6cd5\u7528LIKE\u6216ILIKE\u5b8c\u5168\u8868\u8fbe\u7684\u6a21\u5f0f\u3002<\/p>\n<div>\n<div class=\"post-table\">\u6f14\u7b97\u5b50\u8aac\u660e<code>~<\/code>\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3059\u308b\u3002\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u3042\u308a\u3002<code>~*<\/code>\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3059\u308b\u3002\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u306a\u3057\u3002<code>!~<\/code>\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3057\u306a\u3044\u3002\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u3042\u308a\u3002<code>!~*<\/code>\u6b63\u898f\u8868\u73fe\u306b\u4e00\u81f4\u3057\u306a\u3044\u3002\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u306a\u3057\u3002<\/div>\n<\/div>\n<p>~ \u662f\u57fa\u7840\u3002<br \/>\n~* \u662f\u5bf9\u4e8e ~ \u7684\u5927\u5c0f\u5199\u4e0d\u654f\u611f\u7248\u672c\u3002<br \/>\n!~\u3001!~* \u5206\u522b\u8868\u793a ~ \u7684\u5426\u5b9a\u548c ~* \u7684\u5426\u5b9a\u3002<\/p>\n<div>\n<div class=\"post-table\">\u4f8b\u7d50\u679c<code>'abc' ~ '^a'<\/code>true<code>'abc' ~* '^a'<\/code>true<code>'abc' ~ '^A'<\/code>false<code>'abc' ~* '^A'<\/code>true<code>'abc' !~ '^a'<\/code>false<code>'abc' !~* '^a'<\/code>false<code>'abc' !~ '^A'<\/code>true<code>'abc' !~* '^A'<\/code>false<\/div>\n<\/div>\n<h1>\u6b63\u5219\u8868\u8fbe\u5f0f\u66ff\u6362<\/h1>\n<p>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u5b57\u7b26\u4e32\u66ff\u6362\u7684\u51fd\u6570\u3002<\/p>\n<p>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u66ff\u6362\u51fd\u6570 `regexp_replace(string text, pattern text, replacement text [, flags text])`<\/p>\n<p>\u5728\u6a21\u5f0f\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u90e8\u5206\u5339\u914d\u5230\u7684\u90e8\u5206\u4f5c\u4e3a\u66ff\u6362\u3002\u5176\u4e2d \\N \u4ee3\u8868\u7b2cN\u4e2a\u62ec\u53f7\u7684\u90e8\u5206\u3002\u5728\u5b9e\u9645\u7684\u66ff\u6362\u4e2d\uff0c\u9700\u8981\u4f7f\u7528\u53cc\u659c\u6760\u8fdb\u884c\u8f6c\u4e49\uff0c\u4f8b\u5982 \\\\1\u3002<\/p>\n<p>\u4e3b\u8981\u7684\u6807\u5fd7<\/p>\n<div>\n<div class=\"post-table\">\u30d5\u30e9\u30b0\u8aac\u660ei\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u3092\u3057\u306a\u3044g\u6700\u521d\u306e\u30de\u30c3\u30c1\u3060\u3051\u3067\u306a\u304f\u5168\u3066\u306e\u30de\u30c3\u30c1\u3092\u7f6e\u63db<\/div>\n<\/div>\n<p>\u6267\u884c\u793a\u4f8b<\/p>\n<div>\n<div class=\"post-table\">\u4f8b\u7d50\u679c<code>REGEXP_REPLACE('abcdeabcde', 'c.', 'X')<\/code>abXeabcde<code>REGEXP_REPLACE('abcdeabcde', 'c.', 'X', 'g')<\/code>abXeabXe<code>REGEXP_REPLACE('ABCDEabcde', 'c.', 'X', 'g')<\/code>ABCDEabXe<code>REGEXP_REPLACE('ABCDEabcde', 'c.', 'X', 'ig')<\/code>ABXEabXe<code>REGEXP_REPLACE('abcdeabcde', 'b(.)d', E'Y\\\\1Z', 'g')<\/code>aYcZeaYcZe<\/div>\n<\/div>\n<h1>\u8bf7\u53c2\u8003\u6b64\u94fe\u63a5\u3002<\/h1>\n<p>PostgreSQL 9.1.5\u6587\u6863 9.7.3\u7248\u672c\u3002POSIX\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<br \/>\nPostgreSQL 9.1.5\u6587\u6863 4.1.2.2\u7248\u672c\u3002\u4f7f\u7528C\u683c\u5f0f\u8f6c\u4e49\u7684\u5b57\u7b26\u4e32\u5e38\u91cf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26 PostgreSQL\u4e2d\u6709\u4e00\u4e2a\u79f0\u4e3a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26\u7684\u7279\u6027\u3002\u5b83\u53ef\u4ee5\u7528\u4e8e\u65e0\u6cd5\u7528LIKE\u6216I [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41577","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728postgresql\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\" \/>\n<meta property=\"og:description\" content=\"\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26 PostgreSQL\u4e2d\u6709\u4e00\u4e2a\u79f0\u4e3a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26\u7684\u7279\u6027\u3002\u5b83\u53ef\u4ee5\u7528\u4e8e\u65e0\u6cd5\u7528LIKE\u6216I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728postgresql\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-26T05:00:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T09:59:52+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/\",\"name\":\"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-26T05:00:46+00:00\",\"dateModified\":\"2024-05-04T09:59:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728postgresql\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f","og_description":"\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26 PostgreSQL\u4e2d\u6709\u4e00\u4e2a\u79f0\u4e3a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u8fd0\u7b97\u7b26\u7684\u7279\u6027\u3002\u5b83\u53ef\u4ee5\u7528\u4e8e\u65e0\u6cd5\u7528LIKE\u6216I [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728postgresql\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-26T05:00:46+00:00","article_modified_time":"2024-05-04T09:59:52+00:00","author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/","name":"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-26T05:00:46+00:00","dateModified":"2024-05-04T09:59:52+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728PostgreSQL\u4e2d\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8postgresql%e4%b8%ad%e4%bd%bf%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=41577"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41577\/revisions"}],"predecessor-version":[{"id":99834,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41577\/revisions\/99834"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=41577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=41577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=41577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}