{"id":155634,"date":"2020-09-06T22:46:29","date_gmt":"2020-09-06T14:46:29","guid":{"rendered":"http:\/\/4563.org\/?p=155634"},"modified":"2020-09-06T22:46:29","modified_gmt":"2020-09-06T14:46:29","slug":"python-%e4%b8%8e-mysql-%e6%ad%a3%e8%a7%84%e5%88%99%e4%b8%8d%e4%b8%80%e6%a0%b7%e5%90%97%ef%bc%9f-%e9%97%ae%e4%b8%aa-mysql-%e6%95%b0%e6%8d%ae%e6%9b%bf%e6%8d%a2%e7%9a%84%e6%ad%a3%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=155634","title":{"rendered":"Python \u4e0e mysql \u6b63\u89c4\u5219\u4e0d\u4e00\u6837\u5417\uff1f \u95ee\u4e2a mysql \u6570\u636e\u66ff\u6362\u7684\u6b63\u89c4\u5219\u3002\u54ea\u4f4d\u670b\u53cb\u5e2e\u6211\u770b\u770b\u4e0b\u9762 mysql \u6b63\u89c4\u5219\u6709\u4ec0\u4e48\u95ee\u9898\uff1f \u8c22\u8c22"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python \u4e0e mysql \u6b63\u89c4\u5219\u4e0d\u4e00\u6837\u5417\uff1f \u95ee\u4e2a mysql \u6570\u636e\u66ff\u6362\u7684\u6b63\u89c4\u5219\u3002\u54ea\u4f4d\u670b\u53cb\u5e2e\u6211\u770b\u770b\u4e0b\u9762 mysql \u6b63\u89c4\u5219\u6709\u4ec0\u4e48\u95ee\u9898\uff1f \u8c22\u8c22               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : python30 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u6570\u636e\u5e93\u91cc\u6709\u4e00\u4e9b\u4e0b\u9762\u683c\u5f0f\u7684\u56fe\u7247\uff1a<br \/>&lt;p&gt;&lt;img alt=&#8221;100 \u53e5\u5e38&#8221; title=&#8221;100 \u53e5\u5e38\uff0c\u4e0d\u72af\u9519&#8221; src=&#8221;http:\/\/pic.baidu.com\/image\/32778.jpg&#8221;&gt;&lt;\/p&gt;<\/p>\n<p>\u8fd9\u56fe\u7247\u5730\u5740\u91cc\u53ea\u6709 http:\/\/pic.baidu.com \u662f\u4e0d\u53d8\u7684\u5176\u5b83\u90fd\u662f\u53d8\u7684<\/p>\n<p>\u4e5f\u6709\u4e00\u4e9b\u7684\u56fe\u7247<\/p>\n<p>&lt;p&gt;&lt;img alt=&#8221;sadfasdfasdfdsf&#8221; title=&#8221;dfasdfasdff&#8221; src=&#8221;http:\/\/pic.google.com\/image\/32778.jpg&#8221;&gt;&lt;\/p&gt;<\/p>\n<p>\u73b0\u5728\u53ea\u60f3\u628a\u5168\u90e8\u7684 \u5e26 http:\/\/pic.baidu.com \u8fd9\u4e2a\u7f51\u5740\u7684\u56fe\u7247\u66ff\u6362\u6389\uff0c\u4e5f\u5c31\u662f\u6e05\u9664\u4e86\u3002<\/p>\n<p>\u5728 mysql \u6570\u636e\u5e93\u91cc \uff0c\u600e\u4e48\u5199\u6b63\u89c4\u5219\u80fd\u5b8c\u6210\u8fd9\u4e2a \u6216\u8005 \u6709\u4ec0\u4e48\u597d\u7684\u65b9\u6cd5\u5417\uff1f<\/p>\n<p>update `bodytext` set body=replace(body, &#8216;&lt;p&gt;&lt;img alt=&#8221;.*&#8221; title=&#8221;.*&#8221; src=&#8221;http:\/\/pic.baidu.com.*&#8221;&gt;&lt;\/p&gt;&#8217;, &#8221;);<\/p>\n<p>\u4e0a\u9762\u662f\u6211\u5199\u7684\u3002\u4e0d\u6210\u529f\u3002<\/p>\n<p>\u8bf7\u54ea\u4f4d\u719f\u6089 mysql \u7684\u670b\u53cb\u5e2e\u6211\u770b\u770b\u600e\u4e48\u6539\uff1f<br \/>\u8c22\u8c22\u3002      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3298190\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhoudaiyu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u592a\u4e00\u6837\uff0c\u6709\u5751\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298191\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : herozzm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             regex101 \u53bb\u770b\u770b \u6b63\u5219\u6709\u597d\u51e0\u79cd\u89c4\u5219                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298192\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhangysh1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @python30 <\/p>\n<p>&#8220;&#8220;<br \/>select REGEXP_LIKE(&#8216;&lt;p&gt;&lt;img alt=&#8221;.&#8221; title=&#8221;.&#8221; src=&#8221;http:\/\/pic.baidu.com.xxx&#8221;&gt;&lt;\/p&gt;&#8217;, <br \/> &#8216;&lt;p&gt;&lt;img alt=&#8221;\\..*&#8221; title=&#8221;\\..*&#8221; src=&#8221;http:\/\/pic.baidu.com\\..*&#8221;&gt;&lt;\/p&gt;&#8217;) as yes;<br \/>&#8220;&#8220;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298193\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhangysh1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             MySQL \u6b63\u5219\u7684\u5404\u79cd\u7528\u6cd5\u548c\u51fd\u6570 https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/regexp.html#regexp-syntax                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298194\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : python30 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zhangysh1995 <br \/>\u8c22\u8c22<br \/>\u6211\u5fd8\u4e86\u8bf4\u4e86<br \/>\u6211\u7684 mysql \u7248\u672c\u662f 5.7<br \/>\u4e0d\u77e5\u9053\u6709\u4ec0\u4e48\u65b9\u6cd5\u80fd\u5b9e\u73b0\u6211\u60f3\u8981\u7684\u529f\u80fd\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298195\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : royzheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u7528 python \u5199\u4e2a\u66f4\u65b0\u7684\u4ee3\u7801\u66f4\u65b0\u4e0b\u4e0d\u5c31\u5f97\u4e86\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3298196\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhangysh1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @python30 5.7 \u6ca1\u6709\u539f\u751f\u6b63\u5219\u652f\u6301\uff0c\u53ef\u4ee5\u81ea\u5df1\u5199\u4e2a\u51fd\u6570\uff0c\u53c2\u8003 https:\/\/stackoverflow.com\/questions\/986826\/how-to-do-a-regular-expression-replace-in-mysql<\/p>\n<p>\u4e0d\u8fc7\u6211\u89c9\u5f97\u4e0a\u8bf4\u7684 Python \u5904\u7406\u4e5f\u633a\u597d\uff0c\u5148\u7528 SQL \u628a\u6ee1\u8db3\u6761\u4ef6\u7684\u7b5b\u9009\u51fa\u6765\u8fd4\u56de\u7ed9\u811a\u672c\uff0c\u518d\u7528 SQL \u66f4\u65b0\u56de\u53bb\u3002\u6570\u636e\u91cf\u4e0d\u662f\u592a\u5927\u7684\u8bdd\u5e94\u8be5\u8fd8\u597d\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python \u4e0e mysql \u6b63\u89c4&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/155634"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155634"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/155634\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155634"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}