{"id":949345,"date":"2024-12-27T00:12:01","date_gmt":"2024-12-26T16:12:01","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/949345.html"},"modified":"2024-12-27T00:12:03","modified_gmt":"2024-12-26T16:12:03","slug":"python%e5%a6%82%e4%bd%95replace%e5%bc%95%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/949345.html","title":{"rendered":"python\u5982\u4f55replace\u5f15\u53f7"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25084349\/575699f2-7203-429b-b137-ebd84828a11b.webp\" alt=\"python\u5982\u4f55replace\u5f15\u53f7\" \/><\/p>\n<p><p> \u4e00\u3001PYTHON\u4e2dREPLACE\u5f15\u53f7\u7684\u65b9\u6cd5\u6982\u8ff0  <\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c<strong>\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>replace()<\/code>\u65b9\u6cd5\u6765\u66ff\u6362\u5f15\u53f7\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u7684<code>re.sub()<\/code>\u65b9\u6cd5\u8fdb\u884c\u66ff\u6362\u3001\u501f\u52a9\u5b57\u7b26\u4e32\u7684\u7ffb\u8bd1\u65b9\u6cd5<code>translate()<\/code><\/strong>\u3002\u5982\u679c\u8981\u66ff\u6362\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684<code>replace()<\/code>\u65b9\u6cd5\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u7b80\u5355\u6613\u7528\uff0c\u5e76\u4e14\u662f\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u4e4b\u4e00\u3002\u5728\u4f7f\u7528<code>replace()<\/code>\u65b9\u6cd5\u65f6\uff0c\u9700\u8981\u6307\u5b9a\u8981\u66ff\u6362\u7684\u5b57\u7b26\u548c\u66ff\u6362\u540e\u7684\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8981\u5c06\u5355\u5f15\u53f7\u66ff\u6362\u4e3a\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528<code>str.replace(&quot;&#39;&quot;, &#39;&quot;&#39;)<\/code>\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u7684\u66ff\u6362\u573a\u666f\uff0c\u5e76\u4e14\u6027\u80fd\u8f83\u597d\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001PYTHON\u4e2d\u4f7f\u7528REPLACE()\u65b9\u6cd5\u66ff\u6362\u5f15\u53f7  <\/p>\n<\/p>\n<p><p><code>replace()<\/code>\u65b9\u6cd5\u662fPython\u4e2d\u5b57\u7b26\u4e32\u5bf9\u8c61\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0c\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u67d0\u4e2a\u5b50\u5b57\u7b26\u4e32\u66ff\u6362\u4e3a\u53e6\u4e00\u4e2a\u5b50\u5b57\u7b26\u4e32\u3002  <\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u57fa\u672c\u7528\u6cd5<\/strong><br \/><code>replace()<\/code>\u65b9\u6cd5\u7684\u57fa\u672c\u8bed\u6cd5\u662f<code>str.replace(old, new[, count])<\/code>\u3002\u5176\u4e2d<code>old<\/code>\u662f\u8981\u88ab\u66ff\u6362\u7684\u5b50\u5b57\u7b26\u4e32\uff0c<code>new<\/code>\u662f\u66ff\u6362\u540e\u7684\u5b50\u5b57\u7b26\u4e32\uff0c<code>count<\/code>\u662f\u53ef\u9009\u53c2\u6570\uff0c\u8868\u793a\u66ff\u6362\u7684\u6b21\u6570\u3002\u5982\u679c\u4e0d\u6307\u5b9a<code>count<\/code>\uff0c\u5219\u4f1a\u66ff\u6362\u6240\u6709\u5339\u914d\u7684\u5b50\u5b57\u7b26\u4e32\u3002  <\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u5047\u8bbe\u6709\u4e00\u4e2a\u5b57\u7b26\u4e32<code>text = &quot;Hello, I&#39;m a Python developer.&quot;<\/code>\uff0c\u8981\u5c06\u5176\u4e2d\u7684\u5355\u5f15\u53f7\u66ff\u6362\u4e3a\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, I&#39;m a Python developer.&quot;  <\/p>\n<p>new_text = text.replace(&quot;&#39;&quot;, &#39;&quot;&#39;)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: Hello, I&quot;m a Python developer.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u66ff\u6362\u591a\u79cd\u5f15\u53f7<\/strong><br \/>\u5982\u679c\u9700\u8981\u66ff\u6362\u591a\u79cd\u5f15\u53f7\uff0c\u4f8b\u5982\u540c\u65f6\u66ff\u6362\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u8fdb\u884c\u591a\u6b21\u8c03\u7528<code>replace()<\/code>\u65b9\u6cd5\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, I&#39;m a &#39;Python&#39; developer.&quot;  <\/p>\n<p>new_text = text.replace(&quot;&#39;&quot;, &#39;&quot;&#39;).replace(&#39;&quot;&#39;, &quot;&#39;&quot;)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: Hello, I&quot;m a &quot;Python&quot; developer.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u66ff\u6362\u5f15\u53f7  <\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5757<code>re<\/code>\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5b57\u7b26\u4e32\u5904\u7406\u529f\u80fd\uff0c\u53ef\u4ee5\u7528\u6765\u66ff\u6362\u590d\u6742\u6a21\u5f0f\u7684\u5b57\u7b26\u4e32\u3002  <\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>re.sub()\u65b9\u6cd5<\/strong><br \/><code>re.sub()<\/code>\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5757\u4e2d\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0c\u7528\u4e8e\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5339\u914d\u9879\u3002\u5176\u57fa\u672c\u8bed\u6cd5\u4e3a<code>re.sub(pattern, repl, string, count=0, flags=0)<\/code>\uff0c\u5176\u4e2d<code>pattern<\/code>\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\uff0c<code>repl<\/code>\u662f\u66ff\u6362\u540e\u7684\u5b57\u7b26\u4e32\uff0c<code>string<\/code>\u662f\u539f\u59cb\u5b57\u7b26\u4e32\uff0c<code>count<\/code>\u662f\u66ff\u6362\u6b21\u6570\uff0c<code>flags<\/code>\u662f\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u6807\u5fd7\u4f4d\u3002  <\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u8981\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\u66ff\u6362\u4e3a\u661f\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re  <\/p>\n<p>text = &quot;Hello, I&#39;m a &#39;Python&#39; developer.&quot;  <\/p>\n<p>new_text = re.sub(r&quot;[\\&quot;&#39;]&quot;, &#39;*&#39;, text)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: Hello, I*m a *Python* developer.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u7075\u6d3b\u6027<\/strong><br \/>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u5b9a\u4e49\u590d\u6742\u7684\u5339\u914d\u6a21\u5f0f\uff0c\u8fd9\u5728\u5904\u7406\u590d\u6742\u5b57\u7b26\u4e32\u66ff\u6362\u65f6\u975e\u5e38\u6709\u7528\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u6839\u636e\u4e0a\u4e0b\u6587\u6761\u4ef6\u66ff\u6362\u5f15\u53f7\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re  <\/p>\n<p>text = &quot;He s<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>d, &#39;Python is awesome.&#39; Then she replied, &#39;Indeed!&#39;.&quot;  <\/p>\n<h2><strong>\u66ff\u6362\u5f15\u53f7\u5185\u7684\u5185\u5bb9\u4e3a\u53cc\u5f15\u53f7  <\/strong><\/h2>\n<p>new_text = re.sub(r&quot;&#39;(.*?)&#39;&quot;, r&#39;&quot;\\1&quot;&#39;, text)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: He said, &quot;Python is awesome.&quot; Then she replied, &quot;Indeed!&quot;.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u4f7f\u7528TRANSLATE()\u65b9\u6cd5\u66ff\u6362\u5f15\u53f7  <\/p>\n<\/p>\n<p><p><code>translate()<\/code>\u65b9\u6cd5\u662f\u53e6\u4e00\u79cd\u66ff\u6362\u5b57\u7b26\u7684\u65b9\u5f0f\uff0c\u901a\u5e38\u7528\u4e8e\u66ff\u6362\u5355\u4e2a\u5b57\u7b26\uff0c\u800c\u4e0d\u662f\u5b57\u7b26\u4e32\u3002  <\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u57fa\u672c\u7528\u6cd5<\/strong><br \/><code>translate()<\/code>\u65b9\u6cd5\u9700\u8981\u4e0e<code>str.maketrans()<\/code>\u65b9\u6cd5\u7ed3\u5408\u4f7f\u7528\u3002<code>str.maketrans()<\/code>\u65b9\u6cd5\u7528\u4e8e\u521b\u5efa\u4e00\u4e2a\u5b57\u7b26\u6620\u5c04\u8868\uff0c\u7136\u540e<code>translate()<\/code>\u65b9\u6cd5\u6839\u636e\u8fd9\u4e2a\u6620\u5c04\u8868\u66ff\u6362\u5b57\u7b26\u3002  <\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u8981\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u5355\u5f15\u53f7\u66ff\u6362\u4e3a\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, I&#39;m a Python developer.&quot;  <\/p>\n<p>translation_table = str.maketrans(&quot;&#39;&quot;, &#39;&quot;&#39;)  <\/p>\n<p>new_text = text.translate(translation_table)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: Hello, I&quot;m a Python developer.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u591a\u4e2a\u5b57\u7b26\u66ff\u6362<\/strong><br \/><code>translate()<\/code>\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u7528\u4e8e\u66ff\u6362\u591a\u4e2a\u5b57\u7b26\uff0c\u53ea\u9700\u5728\u6620\u5c04\u8868\u4e2d\u6dfb\u52a0\u66f4\u591a\u7684\u6620\u5c04\u5173\u7cfb\u3002  <\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;Hello, &#39;Python&#39; developer.&quot;  <\/p>\n<p>translation_table = str.maketrans({&quot;&#39;&quot;: &#39;&quot;&#39;, &#39;&quot;&#39;: &quot;&#39;&quot;})  <\/p>\n<p>new_text = text.translate(translation_table)  <\/p>\n<p>print(new_text)  # \u8f93\u51fa: Hello, &quot;Python&quot; developer.  <\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u5e94\u7528\u573a\u666f\u4e0e\u6027\u80fd\u8003\u8651  <\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5<\/strong><br \/>\u5728\u9009\u62e9\u66ff\u6362\u5f15\u53f7\u7684\u65b9\u6cd5\u65f6\uff0c\u5e94\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002\u5982\u679c\u53ea\u662f\u7b80\u5355\u5730\u66ff\u6362\u67d0\u79cd\u5355\u4e00\u5b57\u7b26\uff0c\u53ef\u4ee5\u4f7f\u7528<code>replace()<\/code>\u6216<code>translate()<\/code>\u65b9\u6cd5\u3002\u5982\u679c\u9700\u8981\u6839\u636e\u590d\u6742\u7684\u5339\u914d\u6761\u4ef6\u8fdb\u884c\u66ff\u6362\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f<code>re.sub()<\/code>\u4f1a\u662f\u4e00\u4e2a\u66f4\u597d\u7684\u9009\u62e9\u3002  <\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6027\u80fd\u8003\u8651<\/strong><br \/>\u5728\u5904\u7406\u8f83\u5927\u7684\u6587\u672c\u65f6\uff0c\u6027\u80fd\u53ef\u80fd\u662f\u4e00\u4e2a\u9700\u8981\u5173\u6ce8\u7684\u95ee\u9898\u3002\u4e00\u822c\u6765\u8bf4\uff0c<code>replace()<\/code>\u548c<code>translate()<\/code>\u65b9\u6cd5\u7684\u6027\u80fd\u4f18\u4e8e<code>re.sub()<\/code>\uff0c\u56e0\u4e3a\u5b83\u4eec\u4e0d\u6d89\u53ca\u590d\u6742\u7684\u6a21\u5f0f\u5339\u914d\u3002\u5982\u679c\u6027\u80fd\u662f\u5173\u952e\u56e0\u7d20\uff0c\u5e76\u4e14\u66ff\u6362\u903b\u8f91\u7b80\u5355\uff0c\u4f18\u5148\u9009\u62e9<code>replace()<\/code>\u6216<code>translate()<\/code>\u3002  <\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u7279\u6b8a\u60c5\u51b5<\/strong><br \/>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6587\u672c\u4e2d\u53ef\u80fd\u5305\u542b\u8f6c\u4e49\u5b57\u7b26\u6216\u5176\u4ed6\u7279\u6b8a\u5b57\u7b26\uff0c\u9700\u8981\u7279\u522b\u5904\u7406\u3002\u4f8b\u5982\uff0cJSON\u683c\u5f0f\u7684\u6570\u636e\u4e2d\uff0c\u5b57\u7b26\u4e32\u5305\u542b\u7684\u5f15\u53f7\u9700\u8981\u88ab\u6b63\u786e\u8f6c\u4e49\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528<code>json<\/code>\u6a21\u5757\u7684<code>loads()<\/code>\u548c<code>dumps()<\/code>\u65b9\u6cd5\u6765\u89e3\u6790\u548c\u751f\u6210JSON\u5b57\u7b26\u4e32\u53ef\u80fd\u66f4\u4e3a\u5408\u9002\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0cPython\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5f15\u53f7\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u4ece\u800c\u8fbe\u5230\u9ad8\u6548\u548c\u6b63\u786e\u7684\u66ff\u6362\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\u5982\u4f55\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>str.replace()<\/code>\u65b9\u6cd5\u6765\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\u3002\u6bd4\u5982\uff0c\u5982\u679c\u60f3\u5c06\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5355\u5f15\u53f7\u66ff\u6362\u4e3a\u53cc\u5f15\u53f7\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<code>new_string = original_string.replace(&quot;&#39;&quot;, &#39;&quot;&#39;)<\/code>\u3002\u5982\u679c\u60f3\u66ff\u6362\u53cc\u5f15\u53f7\u4e3a\u5355\u5f15\u53f7\uff0c\u53ea\u9700\u53cd\u8f6c\u5f15\u53f7\u5373\u53ef\uff1a<code>new_string = original_string.replace(&#39;&quot;&#39;, &quot;&#39;&quot;)<\/code>\u3002<\/p>\n<p><strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u66ff\u6362\u5f15\u53f7\u7684\u6700\u4f73\u5b9e\u8df5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5bf9\u4e8e\u590d\u6742\u7684\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>re<\/code>\u6a21\u5757\u4e2d\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u4f7f\u7528<code>re.sub()<\/code>\u51fd\u6570\u80fd\u591f\u66f4\u7075\u6d3b\u5730\u5339\u914d\u548c\u66ff\u6362\u5f15\u53f7\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u7528<code>re.sub(r&quot;[&#39;\\&quot;]&quot;, &#39;&quot;&#39;, original_string)<\/code>\u6765\u5c06\u6240\u6709\u5355\u5f15\u53f7\u548c\u53cc\u5f15\u53f7\u66ff\u6362\u4e3a\u53cc\u5f15\u53f7\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u5728\u4e8e\u80fd\u591f\u4e00\u6b21\u6027\u5904\u7406\u591a\u79cd\u60c5\u51b5\uff0c\u5c24\u5176\u662f\u5728\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\u591a\u79cd\u5f62\u5f0f\u7684\u5f15\u53f7\u65f6\u3002<\/p>\n<p><strong>\u5728\u6570\u636e\u5904\u7406\u8fc7\u7a0b\u4e2d\u66ff\u6362\u5f15\u53f7\u53ef\u80fd\u5f15\u53d1\u54ea\u4e9b\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u6570\u636e\u5904\u7406\u6216\u6587\u672c\u6e05\u7406\u7684\u8fc7\u7a0b\u4e2d\uff0c\u66ff\u6362\u5f15\u53f7\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4e00\u4e9b\u95ee\u9898\uff0c\u4f8b\u5982\u5728JSON\u6570\u636e\u4e2d\uff0c\u9519\u8bef\u7684\u66ff\u6362\u53ef\u80fd\u4f1a\u5bfc\u81f4\u89e3\u6790\u9519\u8bef\u3002\u786e\u4fdd\u5728\u66ff\u6362\u524d\u7406\u89e3\u6570\u636e\u7684\u7ed3\u6784\u548c\u5f15\u53f7\u7684\u7528\u9014\u975e\u5e38\u91cd\u8981\u3002\u6b64\u5916\uff0c\u66ff\u6362\u540e\u5e94\u8fdb\u884c\u9a8c\u8bc1\uff0c\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u51c6\u786e\u6027\u6ca1\u6709\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001PYTHON\u4e2dREPLACE\u5f15\u53f7\u7684\u65b9\u6cd5\u6982\u8ff0 \u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u7684replace()\u65b9\u6cd5\u6765\u66ff\u6362 [&hellip;]","protected":false},"author":3,"featured_media":949348,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/949345"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=949345"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/949345\/revisions"}],"predecessor-version":[{"id":949350,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/949345\/revisions\/949350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/949348"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=949345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=949345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=949345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}