{"id":2887,"date":"2024-11-28T22:30:36","date_gmt":"2024-11-28T14:30:36","guid":{"rendered":"http:\/\/viplao.com\/?p=2887"},"modified":"2024-11-28T22:30:36","modified_gmt":"2024-11-28T14:30:36","slug":"python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1","status":"publish","type":"post","link":"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/","title":{"rendered":"PYTHON\u57fa\u7840\u6280\u80fd \u2013\u00a0Python\u4e2d\u5229\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u768416\u4e2a\u5e38\u89c1\u4efb\u52a1"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_71 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><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><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#1_%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F\" title=\"1. \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4ec0\u4e48\uff1f\">1. \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4ec0\u4e48\uff1f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#2_%E5%AE%89%E8%A3%85%E4%B8%8E%E5%AF%BC%E5%85%A5\" title=\"2. \u5b89\u88c5\u4e0e\u5bfc\u5165\">2. \u5b89\u88c5\u4e0e\u5bfc\u5165<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#3_%E5%AD%97%E7%AC%A6%E5%8C%B9%E9%85%8D\" title=\"3. \u5b57\u7b26\u5339\u914d\">3. \u5b57\u7b26\u5339\u914d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#4_%E8%8C%83%E5%9B%B4%E5%8C%B9%E9%85%8D\" title=\"4. \u8303\u56f4\u5339\u914d\">4. \u8303\u56f4\u5339\u914d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#5_%E6%8E%92%E9%99%A4%E5%AD%97%E7%AC%A6\" title=\"5. \u6392\u9664\u5b57\u7b26\">5. \u6392\u9664\u5b57\u7b26<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#6_%E5%AD%97%E7%AC%A6%E9%9B%86%E7%BB%84%E5%90%88\" title=\"6. \u5b57\u7b26\u96c6\u7ec4\u5408\">6. \u5b57\u7b26\u96c6\u7ec4\u5408<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#7_%E4%BD%8D%E7%BD%AE%E9%94%9A%E5%AE%9A\" title=\"7. \u4f4d\u7f6e\u951a\u5b9a\">7. \u4f4d\u7f6e\u951a\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#8_%E5%88%86%E7%BB%84%E4%B8%8E%E5%BC%95%E7%94%A8\" title=\"8. \u5206\u7ec4\u4e0e\u5f15\u7528\">8. \u5206\u7ec4\u4e0e\u5f15\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#9_%E9%9D%9E%E6%8D%95%E8%8E%B7%E7%BB%84\" title=\"9. \u975e\u6355\u83b7\u7ec4\">9. \u975e\u6355\u83b7\u7ec4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#10_%E6%9B%BF%E6%8D%A2%E6%96%87%E6%9C%AC\" title=\"10. \u66ff\u6362\u6587\u672c\">10. \u66ff\u6362\u6587\u672c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#11_%E8%B4%AA%E5%A9%AA%E4%B8%8E%E9%9D%9E%E8%B4%AA%E5%A9%AA%E5%8C%B9%E9%85%8D\" title=\"11. \u8d2a\u5a6a\u4e0e\u975e\u8d2a\u5a6a\u5339\u914d\">11. \u8d2a\u5a6a\u4e0e\u975e\u8d2a\u5a6a\u5339\u914d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#12_%E6%9D%A1%E4%BB%B6%E5%88%86%E6%94%AF\" title=\"12. \u6761\u4ef6\u5206\u652f\">12. \u6761\u4ef6\u5206\u652f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#13_%E9%87%8D%E5%A4%8D%E9%99%90%E5%AE%9A%E7%AC%A6\" title=\"13. \u91cd\u590d\u9650\u5b9a\u7b26\">13. \u91cd\u590d\u9650\u5b9a\u7b26<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#14_%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6\" title=\"14. \u7279\u6b8a\u5b57\u7b26\">14. \u7279\u6b8a\u5b57\u7b26<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#15_%E8%BE%B9%E7%95%8C%E9%99%90%E5%AE%9A%E7%AC%A6\" title=\"15. \u8fb9\u754c\u9650\u5b9a\u7b26\">15. \u8fb9\u754c\u9650\u5b9a\u7b26<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#16_%E6%A0%87%E5%BF%97%E4%BD%8D\" title=\"16. \u6807\u5fd7\u4f4d\">16. \u6807\u5fd7\u4f4d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/#%E5%AE%9E%E6%88%98%E6%A1%88%E4%BE%8B%E5%88%86%E6%9E%90\" title=\"\u5b9e\u6218\u6848\u4f8b\u5206\u6790\">\u5b9e\u6218\u6848\u4f8b\u5206\u6790<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F\"><\/span><strong>1. \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4ec0\u4e48\uff1f<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4e00\u79cd\u7528\u4e8e\u5339\u914d\u5b57\u7b26\u4e32\u7684\u8bed\u8a00\u3002\u5b83\u7531\u4e00\u7cfb\u5217\u5b57\u7b26\u548c\u7279\u6b8a\u7b26\u53f7\u7ec4\u6210\uff0c\u7528\u6765\u63cf\u8ff0\u641c\u7d22\u6a21\u5f0f\u3002\u5728Python\u4e2d\uff0c<code>re<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u652f\u6301\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E5%AE%89%E8%A3%85%E4%B8%8E%E5%AF%BC%E5%85%A5\"><\/span><strong>2. \u5b89\u88c5\u4e0e\u5bfc\u5165<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86<code>re<\/code>\u6a21\u5757\u3002\u8fd9\u662fPython\u7684\u6807\u51c6\u5e93\u4e4b\u4e00\uff0c\u6240\u4ee5\u901a\u5e38\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import&nbsp;re<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E5%AD%97%E7%AC%A6%E5%8C%B9%E9%85%8D\"><\/span><strong>3. \u5b57\u7b26\u5339\u914d<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>\u5355\u4e2a\u5b57\u7b26<\/strong>\uff1a\u4f7f\u7528\u65b9\u62ec\u53f7<code>[]<\/code>\u8868\u793a\u4e00\u7ec4\u5b57\u7b26\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u4efb\u4f55\u5b57\u6bcd<\/em><br>pattern&nbsp;=&nbsp;\"&#91;a-zA-Z]\"<br>string&nbsp;=&nbsp;\"Hello&nbsp;World!\"<br>match&nbsp;=&nbsp;re.search(pattern,&nbsp;string)<br>print(match.group())&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;H<\/em><\/code><\/pre>\n\n\n\n<ul>\n<li><strong>\u591a\u4e2a\u5b57\u7b26<\/strong>\uff1a\u4f7f\u7528<code>*<\/code>\u8868\u793a\u96f6\u6b21\u6216\u591a\u6b21\u51fa\u73b0\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u4efb\u610f\u6570\u91cf\u7684\u7a7a\u683c<\/em><br>pattern&nbsp;=&nbsp;\"\\s*\"<br>string&nbsp;=&nbsp;\"&nbsp;&nbsp;&nbsp;&nbsp;Hello&nbsp;World!\"<br>match&nbsp;=&nbsp;re.match(pattern,&nbsp;string)<br>print(match.group())&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;'&nbsp;&nbsp;&nbsp;&nbsp;'<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_%E8%8C%83%E5%9B%B4%E5%8C%B9%E9%85%8D\"><\/span><strong>4. \u8303\u56f4\u5339\u914d<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528<code>-<\/code>\u5b9a\u4e49\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u5c0f\u5199\u5b57\u6bcda\u5230e<\/em><br>pattern&nbsp;=&nbsp;\"&#91;a-e]\"<br>string&nbsp;=&nbsp;\"abcdeABCDE\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'a',&nbsp;'b',&nbsp;'c',&nbsp;'d',&nbsp;'e']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_%E6%8E%92%E9%99%A4%E5%AD%97%E7%AC%A6\"><\/span><strong>5. \u6392\u9664\u5b57\u7b26<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528<code>^<\/code>\u6392\u9664\u67d0\u4e9b\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u9664\u4e86a\u5230z\u4e4b\u5916\u7684\u6240\u6709\u5b57\u7b26<\/em><br>pattern&nbsp;=&nbsp;\"&#91;^a-z]\"<br>string&nbsp;=&nbsp;\"123ABCdef\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'1',&nbsp;'2',&nbsp;'3',&nbsp;'A',&nbsp;'B',&nbsp;'C']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_%E5%AD%97%E7%AC%A6%E9%9B%86%E7%BB%84%E5%90%88\"><\/span><strong>6. \u5b57\u7b26\u96c6\u7ec4\u5408<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u53ef\u4ee5\u5c06\u591a\u4e2a\u5b57\u7b26\u96c6\u7ec4\u5408\u8d77\u6765\u4f7f\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u6570\u5b57\u6216\u5927\u5199\u5b57\u6bcd<\/em><br>pattern&nbsp;=&nbsp;\"&#91;0-9A-Z]+\"<br>string&nbsp;=&nbsp;\"Hello123World\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'123']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_%E4%BD%8D%E7%BD%AE%E9%94%9A%E5%AE%9A\"><\/span><strong>7. \u4f4d\u7f6e\u951a\u5b9a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><code>^<\/code>\u8868\u793a\u884c\u9996\uff0c<code>$<\/code>\u8868\u793a\u884c\u5c3e\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u4ee5\u5927\u5199\u5b57\u6bcd\u5f00\u5934\u7684\u5355\u8bcd<\/em><br>pattern&nbsp;=&nbsp;\"^&#91;A-Z]&#91;a-zA-Z]*\"<br>string&nbsp;=&nbsp;\"Hello&nbsp;world\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'Hello']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_%E5%88%86%E7%BB%84%E4%B8%8E%E5%BC%95%E7%94%A8\"><\/span><strong>8. \u5206\u7ec4\u4e0e\u5f15\u7528<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528\u5706\u62ec\u53f7<code>()<\/code>\u6765\u521b\u5efa\u4e00\u4e2a\u6355\u83b7\u7ec4\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u6355\u83b7\u65e5\u671f\u683c\u5f0f<\/em><br>pattern&nbsp;=&nbsp;\"(\\d{4})-(\\d{2})-(\\d{2})\"<br>string&nbsp;=&nbsp;\"Today&nbsp;is&nbsp;2023-04-01.\"<br>match&nbsp;=&nbsp;re.match(pattern,&nbsp;\"2023-04-01\")<br>if&nbsp;match:<br>&nbsp;&nbsp;&nbsp;&nbsp;year&nbsp;=&nbsp;match.group(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;month&nbsp;=&nbsp;match.group(2)<br>&nbsp;&nbsp;&nbsp;&nbsp;day&nbsp;=&nbsp;match.group(3)<br>&nbsp;&nbsp;&nbsp;&nbsp;print(f\"Year:&nbsp;{year},&nbsp;Month:&nbsp;{month},&nbsp;Day:&nbsp;{day}\")<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_%E9%9D%9E%E6%8D%95%E8%8E%B7%E7%BB%84\"><\/span><strong>9. \u975e\u6355\u83b7\u7ec4<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u5982\u679c\u4e0d\u5173\u5fc3\u67d0\u90e8\u5206\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528<code>(?:)<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u4e0d\u6355\u83b7\u4e2d\u95f4\u7684\u5192\u53f7<\/em><br>pattern&nbsp;=&nbsp;r\"(\\d{2}):(?:\\d{2}):\\d{2}\"<br>string&nbsp;=&nbsp;\"09:30:15\"<br>match&nbsp;=&nbsp;re.match(pattern,&nbsp;string)<br>if&nbsp;match:<br>&nbsp;&nbsp;&nbsp;&nbsp;hour&nbsp;=&nbsp;match.group(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;print(hour)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;09<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_%E6%9B%BF%E6%8D%A2%E6%96%87%E6%9C%AC\"><\/span><strong>10. \u66ff\u6362\u6587\u672c<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528<code>re.sub()<\/code>\u65b9\u6cd5\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5339\u914d\u9879\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5c06\u6240\u6709\u7a7a\u683c\u66ff\u6362\u6210\u4e0b\u5212\u7ebf<\/em><br>pattern&nbsp;=&nbsp;\"\\s+\"<br>string&nbsp;=&nbsp;\"Hello&nbsp;&nbsp;&nbsp;World\"<br>new_string&nbsp;=&nbsp;re.sub(pattern,&nbsp;\"_\",&nbsp;string)<br>print(new_string)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;Hello_World<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"11_%E8%B4%AA%E5%A9%AA%E4%B8%8E%E9%9D%9E%E8%B4%AA%E5%A9%AA%E5%8C%B9%E9%85%8D\"><\/span><strong>11. \u8d2a\u5a6a\u4e0e\u975e\u8d2a\u5a6a\u5339\u914d<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>\u8d2a\u5a6a\u5339\u914d<\/strong>\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u5c3d\u53ef\u80fd\u591a\u5730\u5339\u914d\u5b57\u7b26\u3002<\/li>\n\n\n\n<li><strong>\u975e\u8d2a\u5a6a\u5339\u914d<\/strong>\uff1a\u4f7f\u7528<code>?<\/code>\u4f7f\u5339\u914d\u53d8\u5f97\u201c\u61d2\u60f0\u201d\uff0c\u5373\u5c3d\u53ef\u80fd\u5c11\u5730\u5339\u914d\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u8d2a\u5a6a\u5339\u914d<\/em><br>pattern&nbsp;=&nbsp;\"&lt;.*&gt;\"<br>string&nbsp;=&nbsp;\"&lt;p&gt;Hello&nbsp;&lt;span&gt;World&lt;\/span&gt;&lt;\/p&gt;\"<br>match&nbsp;=&nbsp;re.search(pattern,&nbsp;string)<br>print(match.group())&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&lt;p&gt;Hello&nbsp;&lt;span&gt;World&lt;\/span&gt;&lt;\/p&gt;<\/em><br><br><em>#&nbsp;\u975e\u8d2a\u5a6a\u5339\u914d<\/em><br>pattern&nbsp;=&nbsp;\"&lt;.*?&gt;\"<br>string&nbsp;=&nbsp;\"&lt;p&gt;Hello&nbsp;&lt;span&gt;World&lt;\/span&gt;&lt;\/p&gt;\"<br>match&nbsp;=&nbsp;re.search(pattern,&nbsp;string)<br>print(match.group())&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&lt;p&gt;<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"12_%E6%9D%A1%E4%BB%B6%E5%88%86%E6%94%AF\"><\/span><strong>12. \u6761\u4ef6\u5206\u652f<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528<code>(?P&lt;name&gt;)<\/code>\u547d\u540d\u6355\u83b7\u7ec4\uff0c\u5e76\u901a\u8fc7<code>(?P=name)<\/code>\u5f15\u7528\u5b83\u4eec\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u91cd\u590d\u7684\u5355\u8bcd<\/em><br>pattern&nbsp;=&nbsp;r\"\\b(\\w+)\\b\\s+\\1\\b\"<br>string&nbsp;=&nbsp;\"hello&nbsp;hello&nbsp;world\"<br>match&nbsp;=&nbsp;re.sub(pattern,&nbsp;r\"\\1\",&nbsp;string,&nbsp;flags=re.IGNORECASE)<br>print(match)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;hello&nbsp;world<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"13_%E9%87%8D%E5%A4%8D%E9%99%90%E5%AE%9A%E7%AC%A6\"><\/span><strong>13. \u91cd\u590d\u9650\u5b9a\u7b26<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li>\u4f7f\u7528<code>{n}<\/code>\u6307\u5b9a\u7cbe\u786e\u91cd\u590d\u6b21\u6570\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528<code>{n,}<\/code>\u6307\u5b9a\u81f3\u5c11\u91cd\u590dn\u6b21\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528<code>{n,m}<\/code>\u6307\u5b9a\u91cd\u590dn\u5230m\u6b21\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u6070\u597d\u91cd\u590d\u4e09\u6b21\u7684\u5b57\u7b26<\/em><br>pattern&nbsp;=&nbsp;r\"a{3}\"<br>string&nbsp;=&nbsp;\"aaabbbccc\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;]<\/em><br><br><em>#&nbsp;\u5339\u914d\u81f3\u5c11\u91cd\u590d\u4e24\u6b21\u7684\u5b57\u7b26<\/em><br>pattern&nbsp;=&nbsp;r\"a{2,}\"<br>string&nbsp;=&nbsp;\"aaabbbccc\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'aaa']<\/em><br><br><em>#&nbsp;\u5339\u914d\u91cd\u590d\u4e24\u5230\u56db\u6b21\u7684\u5b57\u7b26<\/em><br>pattern&nbsp;=&nbsp;r\"a{2,4}\"<br>string&nbsp;=&nbsp;\"aaabbbccc\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'aaa']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"14_%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6\"><\/span><strong>14. \u7279\u6b8a\u5b57\u7b26<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>\u70b9\u53f7<\/strong> <code>.<\/code>\uff1a\u5339\u914d\u9664\u6362\u884c\u7b26\u4e4b\u5916\u7684\u4efb\u4f55\u5b57\u7b26\u3002<\/li>\n\n\n\n<li><strong>\u53cd\u659c\u6760<\/strong> <code>\\<\/code>\uff1a\u8f6c\u4e49\u7279\u6b8a\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u5305\u542b\u4efb\u4f55\u5b57\u7b26\u7684\u5355\u8bcd<\/em><br>pattern&nbsp;=&nbsp;r\"\\w+\"<br>string&nbsp;=&nbsp;\"hello\\nworld\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'hello']<\/em><br><br><em>#&nbsp;\u5339\u914d\u7279\u6b8a\u5b57\u7b26<\/em><br>pattern&nbsp;=&nbsp;r\"\\.\"<br>string&nbsp;=&nbsp;\"hello.world\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'.']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"15_%E8%BE%B9%E7%95%8C%E9%99%90%E5%AE%9A%E7%AC%A6\"><\/span><strong>15. \u8fb9\u754c\u9650\u5b9a\u7b26<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>\u5355\u8bcd\u8fb9\u754c<\/strong> <code>\\b<\/code>\uff1a\u5339\u914d\u5355\u8bcd\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u3002<\/li>\n\n\n\n<li><strong>\u975e\u5355\u8bcd\u8fb9\u754c<\/strong> <code>\\B<\/code>\uff1a\u5339\u914d\u975e\u5355\u8bcd\u7684\u4f4d\u7f6e\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5339\u914d\u5355\u8bcd\u8fb9\u754c<\/em><br>pattern&nbsp;=&nbsp;r\"\\bhello\\b\"<br>string&nbsp;=&nbsp;\"hello&nbsp;world\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'hello']<\/em><br><br><em>#&nbsp;\u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c<\/em><br>pattern&nbsp;=&nbsp;r\"\\Bworld\\B\"<br>string&nbsp;=&nbsp;\"hello&nbsp;world\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;]<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"16_%E6%A0%87%E5%BF%97%E4%BD%8D\"><\/span><strong>16. \u6807\u5fd7\u4f4d<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>\u5ffd\u7565\u5927\u5c0f\u5199<\/strong> <code>re.IGNORECASE<\/code>\uff1a\u4f7f\u5339\u914d\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u3002<\/li>\n\n\n\n<li><strong>\u591a\u884c\u6a21\u5f0f<\/strong> <code>re.MULTILINE<\/code>\uff1a\u4f7f<code>^<\/code>\u548c<code>$<\/code>\u5206\u522b\u5339\u914d\u6bcf\u4e00\u884c\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u3002<\/li>\n\n\n\n<li><strong>\u70b9\u53f7\u5339\u914d\u6362\u884c\u7b26<\/strong> <code>re.DOTALL<\/code>\uff1a\u4f7f<code>.<\/code>\u5339\u914d\u5305\u62ec\u6362\u884c\u7b26\u5728\u5185\u7684\u4efb\u4f55\u5b57\u7b26\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u5ffd\u7565\u5927\u5c0f\u5199<\/em><br>pattern&nbsp;=&nbsp;r\"hello\"<br>string&nbsp;=&nbsp;\"Hello&nbsp;world\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string,&nbsp;re.IGNORECASE)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'Hello']<\/em><br><br><em>#&nbsp;\u591a\u884c\u6a21\u5f0f<\/em><br>pattern&nbsp;=&nbsp;r\"^hello\"<br>string&nbsp;=&nbsp;\"hello\\nworld\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string,&nbsp;re.MULTILINE)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'hello']<\/em><br><br><em>#&nbsp;\u70b9\u53f7\u5339\u914d\u6362\u884c\u7b26<\/em><br>pattern&nbsp;=&nbsp;r\"hello.*world\"<br>string&nbsp;=&nbsp;\"hello\\nworld\"<br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string,&nbsp;re.DOTALL)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'hello\\nworld']<\/em><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%9E%E6%88%98%E6%A1%88%E4%BE%8B%E5%88%86%E6%9E%90\"><\/span><strong>\u5b9e\u6218\u6848\u4f8b\u5206\u6790<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5047\u8bbe\u6211\u4eec\u9700\u8981\u4ece\u4e00\u6bb5\u6587\u672c\u4e2d\u63d0\u53d6\u6240\u6709\u7684\u90ae\u7bb1\u5730\u5740\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u6b63\u5219\u8868\u8fbe\u5f0f\u8f7b\u677e\u5b9e\u73b0\u3002\u90ae\u7bb1\u5730\u5740\u7684\u4e00\u822c\u5f62\u5f0f\u4e3a <code>username@domain.com<\/code>\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>#&nbsp;\u63d0\u53d6\u90ae\u7bb1\u5730\u5740<\/em><br>pattern&nbsp;=&nbsp;r\"&#91;a-zA-Z0-9._%+-]+@&#91;a-zA-Z0-9.-]+\\.&#91;a-zA-Z]{2,}\"<br>string&nbsp;=&nbsp;\"\"\"<br>John&nbsp;Doe&nbsp;&lt;johndoe@example.com&gt;<br>Jane&nbsp;Smith&nbsp;&lt;janesmith@company.org&gt;<br>\"\"\"<br><br>matches&nbsp;=&nbsp;re.findall(pattern,&nbsp;string)<br>print(matches)&nbsp;&nbsp;<em>#&nbsp;\u8f93\u51fa:&nbsp;&#91;'johndoe@example.com',&nbsp;'janesmith@company.org']<\/em><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4ec0\u4e48\uff1f \u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4e00\u79cd\u7528\u4e8e\u5339\u914d\u5b57\u7b26\u4e32\u7684\u8bed\u8a00\u3002\u5b83\u7531\u4e00\u7cfb\u5217\u5b57\u7b26\u548c\u7279\u6b8a\u7b26\u53f7\u7ec4\u6210\uff0c\u7528\u6765\u63cf&hellip; <a href=\"http:\/\/viplao.com\/index.php\/2024\/11\/28\/python%e5%9f%ba%e7%a1%80%e6%8a%80%e8%83%bd-python%e4%b8%ad%e5%88%a9%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e7%9a%8416%e4%b8%aa%e5%b8%b8%e8%a7%81%e4%bb%bb%e5%8a%a1\/\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">PYTHON\u57fa\u7840\u6280\u80fd \u2013\u00a0Python\u4e2d\u5229\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u768416\u4e2a\u5e38\u89c1\u4efb\u52a1<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[28],"views":1076,"_links":{"self":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/2887"}],"collection":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/comments?post=2887"}],"version-history":[{"count":1,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/2887\/revisions"}],"predecessor-version":[{"id":2888,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/2887\/revisions\/2888"}],"wp:attachment":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/media?parent=2887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/categories?post=2887"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/tags?post=2887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}