{"id":230128,"date":"2020-12-21T01:53:47","date_gmt":"2020-12-20T17:53:47","guid":{"rendered":"http:\/\/4563.org\/?p=230128"},"modified":"2020-12-21T01:53:47","modified_gmt":"2020-12-20T17:53:47","slug":"%e6%ad%a3%e5%88%99%ef%bc%8c%e8%af%b7%e9%97%ae%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e5%8c%b9%e9%85%8d%e6%9c%80%e5%86%85%e5%b1%82%e7%9a%84%e5%86%85%e5%ae%b9","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=230128","title":{"rendered":"\u6b63\u5219\uff0c\u8bf7\u95ee\u5982\u4f55\u5b9e\u73b0\u5339\u914d\u6700\u5185\u5c42\u7684\u5185\u5bb9"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6b63\u5219\uff0c\u8bf7\u95ee\u5982\u4f55\u5b9e\u73b0\u5339\u914d\u6700\u5185\u5c42\u7684\u5185\u5bb9               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : caneman <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>123start123 1111111111 4567start4567 **** **** **** 789end789 1234end1234 <\/code><\/pre>\n<p>\u5982\u4f55\u5339\u914d\u4e2d\u95f4\u7684\u4e09\u884c &#8216;****&#8217;\uff0c\u4f7f\u5f97\u6700\u7ec8\u8f93\u51fa\u4e3a\uff1a<\/p>\n<pre><code>*** *** *** <\/code><\/pre>\n<p>\u6709\u591a\u4e2a start \u3001end \u6807\u8bb0\uff08\u4e0d\u4e00\u5b9a\u6210\u5bf9\u51fa\u73b0\uff09\uff0cstart \u3001end \u4e4b\u524d\u4e4b\u540e\u7684\u6709\u591a\u4e2a\u4e0d\u5b9a\u957f\u5b57\u7b26<\/p>\n<pre><code>n.*start.*n([sS]*?)n.*end <\/code><\/pre>\n<p>PS\uff1a\u80fd\u89e3\u51b3\u7684\u65b9\u6848\u76ee\u524d\u6709\u4e0b\u9762\u8fd9\u79cd\uff0c\u4e0d\u77e5\u9053\u4e0b\u9762\u8fd9\u4e2a\u80fd\u4e0d\u80fd\u6ee1\u8db3\u4e0a\u9762\u7684\u9700\u6c42\uff08\u6837\u4f8b\u4e4b\u5916\u7684\uff09\uff0c\u6709\u6ca1\u6709\u7b80\u5355\u70b9\u7684\uff0c\u6216\u8005\u78b0\u5230\u8fd9\u79cd\u4e00\u822c\u600e\u4e48\u89e3\u51b3\u6bd4\u8f83\u597d\uff1f<\/p>\n<pre><code>(?s)n[^n]*start[^n]*n((.(?!start))*?)n[^n]*end <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>10<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4720635\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lululau <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u641c\u201cPython recursive regexp\u201d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720636\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lovecy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u4e2a\u6211\u6ca1\u770b\u61c2\u5230\u5e95\u8981\u5e72\u4ec0\u4e48<br \/>\u7ed9\u7684\u6b63\u5219\u4f8b\u5b50\u4e5f\u65e0\u6cd5\u5339\u914d\u4f60\u6837\u4f8b\u91cc\u7684\u4e2d\u95f4\u4e09\u884c\u3002\u3002\u3002\u3002<br \/>\u5efa\u8bae\u91cd\u65b0\u68b3\u7406\u4e00\u4e0b\u9898\u76ee                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720637\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shyrock <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u5f00\u59cb\u4ee5\u4e3a\u662f\u8981\u5265\u79bb\u6210\u5bf9\u51fa\u73b0\u7684 start \u548c end\uff0c\u7ed3\u679c\u53d1\u73b0\u4e0d\u662f\u3002\u90a3\u4e48\u4f60\u8981\u5265\u79bb\u7684\u6587\u672c\u5230\u5e95\u662f\u4ec0\u4e48\u7279\u5f81\uff1f\u5c31\u662f\u4e00\u884c\u91cc\u9762\u6709\u2018start\u2019\u6216\u8005\u2018end\u2019\u7684\u90fd\u5265\u79bb\uff1f\u201811111111\u2019\u4e5f\u5265\u79bb\uff1f\u4e0d\u50cf\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720638\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : caneman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lululau <br \/>\u8c22\u8c22~<\/p>\n<p>@lovecy <br \/>\u53ef\u4ee5\u7684\uff0c\u4e0a\u9762\u90a3\u4e2a\u7b2c\u4e8c\u6761\u624d\u53ef\u4ee5<br \/>(?s)n[^n]*start[^n]*n((.(?!start))*?)n[^n]*end<br \/>\u8fd9\u4e2a\u6709\u5006 group\uff0c\u5728 group1 \u91cc\u9762<\/p>\n<p>\u4e0b\u9762\u8fd9\u4e2a\u5c31\u53ea\u6709\u4e00\u4e2a\u7ec4\u4e86<br \/>(?s)n[^n]*start[^n]*n((?:.(?!start))*?)n[^n]*end<\/p>\n<p>https:\/\/regex101.com\/r\/qWCjxp\/1\/                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720639\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : caneman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shyrock 111 \u4e5f\u4e0d\u8981\uff0c\u53ea\u8981\u6700\u5185\u5c42\u7684<br \/>\u53ef\u4ee5\u7406\u89e3\u4e3a\u6700\u540e\u4e00\u4e2a start \u6240\u5728\u7684\u90a3\u4e00\u884c\uff08\u4e0d\u5305\u62ec\u6b64\u884c\uff09\u548c\u7b2c\u4e00\u4e2a end \u6240\u5728\u90a3\u4e00\u884c\uff08\u4e0d\u5305\u62ec\u6b64\u884c\uff09\u4e2d\u95f4\u5939\u7740\u7684\u4e1c\u897f<\/p>\n<p>\u4f60\u53ef\u4ee5\u89c1\u4e0a\u9762\u6211\u56de\u590d\u4e2d\u8d34\u7684 regex101 \u94fe\u63a5                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720640\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : caneman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shyrock \u53ef\u4ee5\u7406\u89e3\u4e3a\uff0c\u5206\u9694\u7b26\u4e3a\uff0c\u7531 start \u548c\u65e0\u5e8f\u5b57\u7b26\u7ec4\u6210\u7684\u884c\uff0c\u7531 end \u548c\u65e0\u5e8f\u5b57\u7b26\u7ec4\u6210\u7684\u884c\uff0c\u4e2d\u95f4\u5939\u7740\u7684\u4e1c\u897f\uff08\u6700\u5185\u5c42\uff09<\/p>\n<p>\u81f3\u4e8e\u6211\u4e3a\u4ec0\u4e48\u8981\u4ecen \u5f00\u59cb\u5339\u914d\uff0c\u662f\u56e0\u4e3a\uff0c\u6211\u5bf9\u8fd9\u4e2a\u884c\u7684\u603b\u5b57\u6570\u662f\u6709\u8981\u6c42\u7684\uff0c\u66f4\u53ef\u80fd\u7684\u60c5\u51b5\u4e0b\u5e94\u8be5\u662f\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\u7684<\/p>\n<p>(?s)n[^n]{0,10}start[^n]{0,10}n((?:(?&lt;!start).)*?)n[^n]{0,10}end                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720641\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : caneman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0a\u9762\u90a3\u4e2a\u94fe\u63a5\uff0c\u6d4b\u8bd5\u6587\u5b57\u524d\u9762\u5e94\u8be5\u518d\u52a0\u4e00\u884c\u5e72\u6270\u884c\uff0c\u7528\u4e0b\u9762\u8fd9\u4e2a\u6bd4\u8f83\u597d<br \/>https:\/\/regex101.com\/r\/qWCjxp\/2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720642\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wlsnx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             (?s).*start[^n]*n(.*?)n[^n]*end<br \/>\u7a0d\u5fae\u77ed\u4e00\u70b9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720643\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lovecy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \/(?:^.*start.*$n)((?:(?!start|end)[sS])*)(?:^.*end.*$)\/gm<br \/>\u6211\u8fd9\u4e2a\u4e5f\u53ef\u4ee5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4720644\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lovecy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u540c\u8bed\u8a00\u7684\u6b63\u5219\u5f15\u64ce\u5b9e\u73b0\u8fd8\u662f\u6709\u5dee\u5f02\u7684\uff0c\u4f60\u7ed9\u7684\u94fe\u63a5\u7528\u7684\u662f PHP \uff08 PCRE \uff09\u7684\u6b63\u5219\u5f15\u64ce\uff0c\u6700\u597d\u7528 PYTHON \u7684\u591a\u6d4b\u8bd5\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5219\uff0c\u8bf7\u95ee\u5982\u4f55\u5b9e\u73b0\u5339\u914d\u6700\u5185\u5c42\u7684\u5185\u5bb9&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\/230128"}],"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=230128"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/230128\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230128"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}