{"id":971046,"date":"2024-12-27T05:31:25","date_gmt":"2024-12-26T21:31:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/971046.html"},"modified":"2024-12-27T05:31:27","modified_gmt":"2024-12-26T21:31:27","slug":"python%e5%a6%82%e4%bd%95%e5%be%aa%e7%8e%af%e6%9f%a5%e6%89%be%e6%96%87%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/971046.html","title":{"rendered":"python\u5982\u4f55\u5faa\u73af\u67e5\u627e\u6587\u672c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24194056\/ea194235-e5ac-489b-8695-8de9fdbbc43b.webp\" alt=\"python\u5982\u4f55\u5faa\u73af\u67e5\u627e\u6587\u672c\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5faa\u73af\u67e5\u627e\u6587\u672c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5faa\u73af\u7ed3\u6784\uff08\u5982for\u6216while\uff09\u4ee5\u53ca\u6587\u672c\u67e5\u627e\u65b9\u6cd5\uff08\u5982str.find()\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\uff09\u6765\u5b9e\u73b0\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u6587\u672c\u4e2d\u641c\u7d22\u7279\u5b9a\u7684\u5b50\u5b57\u7b26\u4e32\u3001\u5173\u952e\u8bcd\u6216\u6a21\u5f0f\uff0c\u5e76\u6267\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5faa\u73af\u67e5\u627e\u6587\u672c\uff0c\u5305\u62ec\u4f7f\u7528\u5b57\u7b26\u4e32\u5185\u7f6e\u65b9\u6cd5\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u548c\u8fed\u4ee3\u5668\u7b49\u6280\u672f\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u5185\u7f6e\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5b57\u7b26\u4e32\u5185\u7f6e\u65b9\u6cd5\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728\u5b57\u7b26\u4e32\u4e2d\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5305\u62ecstr.find()\u548cstr.index()\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528str.find()<\/strong><\/li>\n<\/ol>\n<p><p>str.find()\u65b9\u6cd5\u7528\u4e8e\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\u3002\u5b83\u8fd4\u56de\u5b50\u5b57\u7b26\u4e32\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff0c\u5982\u679c\u6ca1\u6709\u627e\u5230\uff0c\u5219\u8fd4\u56de-1\u3002\u53ef\u4ee5\u4f7f\u7528\u5faa\u73af\u6765\u67e5\u627e\u6587\u672c\u4e2d\u7684\u6240\u6709\u5339\u914d\u9879\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def find_all_occurrences(text, sub):<\/p>\n<p>    occurrences = []<\/p>\n<p>    index = text.find(sub)<\/p>\n<p>    while index != -1:<\/p>\n<p>        occurrences.append(index)<\/p>\n<p>        index = text.find(sub, index + 1)<\/p>\n<p>    return occurrences<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>print(find_all_occurrences(text, sub))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0cfind_all_occurrences\u51fd\u6570\u8fd4\u56de\u6240\u6709\u51fa\u73b0\u5b50\u5b57\u7b26\u4e32\u7684\u8d77\u59cb\u7d22\u5f15\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528str.index()<\/strong><\/li>\n<\/ol>\n<p><p>str.index()\u65b9\u6cd5\u4e0estr.find()\u7c7b\u4f3c\uff0c\u4f46\u5728\u6ca1\u6709\u627e\u5230\u5b50\u5b57\u7b26\u4e32\u65f6\u4f1a\u5f15\u53d1ValueError\u5f02\u5e38\u3002\u8fd9\u53ef\u80fd\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u66f4\u6709\u7528\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5f3a\u5236\u5904\u7406\u672a\u627e\u5230\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def find_all_occurrences_with_index(text, sub):<\/p>\n<p>    occurrences = []<\/p>\n<p>    try:<\/p>\n<p>        index = text.index(sub)<\/p>\n<p>        while index != -1:<\/p>\n<p>            occurrences.append(index)<\/p>\n<p>            index = text.index(sub, index + 1)<\/p>\n<p>    except ValueError:<\/p>\n<p>        pass<\/p>\n<p>    return occurrences<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>print(find_all_occurrences_with_index(text, sub))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<\/p>\n<\/p>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u5728\u6587\u672c\u4e2d\u67e5\u627e\u590d\u6742\u7684\u6a21\u5f0f\u3002Python\u7684re\u6a21\u5757\u63d0\u4f9b\u4e86\u5bf9\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>re.finditer()<\/strong><\/li>\n<\/ol>\n<p><p>re.finditer()\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u751f\u6210\u5339\u914d\u5bf9\u8c61\uff0c\u53ef\u4ee5\u5728\u6587\u672c\u4e2d\u67e5\u627e\u6240\u6709\u5339\u914d\u7684\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>def find_with_regex(text, pattern):<\/p>\n<p>    matches = []<\/p>\n<p>    for match in re.finditer(pattern, text):<\/p>\n<p>        matches.append((match.start(), match.group()))<\/p>\n<p>    return matches<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>pattern = r&quot;text&quot;<\/p>\n<p>print(find_with_regex(text, pattern))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528re.finditer()\u67e5\u627e\u6240\u6709\u51fa\u73b0\u7684\u201ctext\u201d\u6a21\u5f0f\uff0c\u5e76\u8fd4\u56de\u5b83\u4eec\u7684\u8d77\u59cb\u7d22\u5f15\u548c\u5339\u914d\u5185\u5bb9\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>re.findall()<\/strong><\/li>\n<\/ol>\n<p><p>re.findall()\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5217\u8868\uff0c\u5305\u542b\u6240\u6709\u5339\u914d\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def find_all_with_regex(text, pattern):<\/p>\n<p>    return re.findall(pattern, text)<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>pattern = r&quot;text&quot;<\/p>\n<p>print(find_all_with_regex(text, pattern))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u867d\u7136re.findall()\u63d0\u4f9b\u4e86\u6240\u6709\u5339\u914d\u9879\u7684\u5217\u8868\uff0c\u4f46\u5b83\u4e0d\u63d0\u4f9b\u7d22\u5f15\u4fe1\u606f\u3002\u5bf9\u4e8e\u9700\u8981\u77e5\u9053\u5339\u914d\u4f4d\u7f6e\u7684\u60c5\u51b5\uff0cre.finditer()\u66f4\u4e3a\u5408\u9002\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u8fed\u4ee3\u5668\u548c\u751f\u6210\u5668<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u8fed\u4ee3\u5668\u548c\u751f\u6210\u5668\u53ef\u4ee5\u4f7f\u4ee3\u7801\u66f4\u4e3a\u7b80\u6d01\u548c\u9ad8\u6548\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u751f\u6210\u5668\u51fd\u6570<\/strong><\/li>\n<\/ol>\n<p><p>\u751f\u6210\u5668\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u67e5\u627e\u6587\u672c\u4e2d\u7684\u6240\u6709\u5339\u914d\u9879\uff0c\u5e76\u5728\u9700\u8981\u65f6\u751f\u6210\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def find_occurrences_generator(text, sub):<\/p>\n<p>    index = text.find(sub)<\/p>\n<p>    while index != -1:<\/p>\n<p>        yield index<\/p>\n<p>        index = text.find(sub, index + 1)<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>for occurrence in find_occurrences_generator(text, sub):<\/p>\n<p>    print(occurrence)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u751f\u6210\u5668\u51fd\u6570find_occurrences_generator\u5728\u67e5\u627e\u5339\u914d\u9879\u65f6\u4f7f\u7528yield\u8fd4\u56de\u7ed3\u679c\uff0c\u4f7f\u5176\u5728\u5185\u5b58\u4f7f\u7528\u4e0a\u66f4\u4e3a\u9ad8\u6548\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528itertools\u6a21\u5757<\/strong><\/li>\n<\/ol>\n<p><p>itertools\u6a21\u5757\u63d0\u4f9b\u4e86\u751f\u6210\u5668\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u590d\u6742\u7684\u5faa\u73af\u903b\u8f91\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import itertools<\/p>\n<p>def find_all_with_itertools(text, sub):<\/p>\n<p>    return list(itertools.takewhile(lambda x: x != -1, (text.find(sub, i) for i in itertools.count())))<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>print(find_all_with_itertools(text, sub))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0citertools.count()\u7528\u4e8e\u751f\u6210\u4e00\u4e2a\u65e0\u9650\u9012\u589e\u7684\u7d22\u5f15\u5e8f\u5217\uff0c\u7ed3\u5408takewhile\u7528\u4e8e\u67e5\u627e\u6240\u6709\u51fa\u73b0\u7684\u5b50\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f18\u5316\u67e5\u627e\u6027\u80fd<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u91cf\u6570\u636e\u6216\u957f\u6587\u672c\u65f6\uff0c\u4f18\u5316\u67e5\u627e\u6027\u80fd\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f18\u5316\u6280\u5de7\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u51cf\u5c11\u641c\u7d22\u8303\u56f4<\/strong><\/li>\n<\/ol>\n<p><p>\u5982\u679c\u5df2\u77e5\u5b50\u5b57\u7b26\u4e32\u53ea\u80fd\u51fa\u73b0\u5728\u6587\u672c\u7684\u67d0\u4e2a\u90e8\u5206\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u5207\u7247\u6765\u51cf\u5c11\u67e5\u627e\u8303\u56f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>start, end = 10, 40  # \u53ea\u5728\u6587\u672c\u7684\u67d0\u4e2a\u8303\u56f4\u5185\u67e5\u627e<\/p>\n<p>print(find_all_occurrences(text[start:end], sub))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528\u66f4\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5c06\u6587\u672c\u8f6c\u6362\u4e3a\u66f4\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\uff08\u5982\u5b57\u5178\u6216\u96c6\u5408\uff09\u53ef\u4ee5\u52a0\u5feb\u67e5\u627e\u901f\u5ea6\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u63d0\u524d\u7ec8\u6b62\u5faa\u73af<\/strong><\/li>\n<\/ol>\n<p><p>\u5982\u679c\u53ea\u9700\u8981\u627e\u5230\u7b2c\u4e00\u4e2a\u5339\u914d\u9879\uff0c\u6216\u8005\u5728\u627e\u5230\u8db3\u591f\u6570\u91cf\u7684\u5339\u914d\u9879\u540e\uff0c\u53ef\u4ee5\u63d0\u524d\u7ec8\u6b62\u67e5\u627e\u5faa\u73af\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def find_first_occurrence(text, sub):<\/p>\n<p>    index = text.find(sub)<\/p>\n<p>    return index if index != -1 else &quot;Not found&quot;<\/p>\n<p>text = &quot;This is a test text for testing text search.&quot;<\/p>\n<p>sub = &quot;text&quot;<\/p>\n<p>print(find_first_occurrence(text, sub))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u591a\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u9ad8\u6548\u5730\u5b9e\u73b0\u5faa\u73af\u67e5\u627e\u6587\u672c\u7684\u529f\u80fd\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u6280\u672f\u548c\u4f18\u5316\u7b56\u7565\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u5faa\u73af\u67e5\u627e\u6587\u672c\u7684\u529f\u80fd\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>for<\/code>\u5faa\u73af\u7ed3\u5408\u5b57\u7b26\u4e32\u7684\u65b9\u6cd5\u8fdb\u884c\u6587\u672c\u67e5\u627e\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>in<\/code>\u8fd0\u7b97\u7b26\u68c0\u67e5\u5b50\u5b57\u7b26\u4e32\u662f\u5426\u5b58\u5728\u4e8e\u4e3b\u5b57\u7b26\u4e32\u4e2d\uff0c\u6216\u4f7f\u7528<code>str.find()<\/code>\u65b9\u6cd5\u67e5\u627e\u5b50\u5b57\u7b26\u4e32\u7684\u7d22\u5f15\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u57fa\u672c\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">text = &quot;\u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\u6587\u672c\uff0c\u5305\u542b\u591a\u4e2a\u793a\u4f8b\u3002&quot;\nkeyword = &quot;\u793a\u4f8b&quot;\nfor i in range(len(text)):\n    if text[i:i+len(keyword)] == keyword:\n        print(f&quot;\u627e\u5230&#39;{keyword}&#39;\u5728\u4f4d\u7f6e: {i}&quot;)\n<\/code><\/pre>\n<p><strong>\u5982\u4f55\u5904\u7406\u5927\u5c0f\u5199\u654f\u611f\u7684\u6587\u672c\u67e5\u627e\uff1f<\/strong><br \/>\u5f53\u9700\u8981\u5ffd\u7565\u5927\u5c0f\u5199\u8fdb\u884c\u6587\u672c\u67e5\u627e\u65f6\uff0c\u53ef\u4ee5\u5c06\u6587\u672c\u548c\u5173\u952e\u5b57\u90fd\u8f6c\u6362\u4e3a\u540c\u4e00\u79cd\u5927\u5c0f\u5199\u3002\u4f7f\u7528<code>str.lower()<\/code>\u6216<code>str.upper()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">text = &quot;\u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\u6587\u672c\uff0c\u5305\u542b\u591a\u4e2a\u793a\u4f8b\u3002&quot;\nkeyword = &quot;\u793a\u4f8b&quot;\ntext_lower = text.lower()\nkeyword_lower = keyword.lower()\n\nfor i in range(len(text_lower)):\n    if text_lower[i:i+len(keyword_lower)] == keyword_lower:\n        print(f&quot;\u627e\u5230&#39;{keyword}&#39;\u5728\u4f4d\u7f6e: {i}&quot;)\n<\/code><\/pre>\n<p><strong>\u5728\u5faa\u73af\u67e5\u627e\u6587\u672c\u65f6\u5982\u4f55\u907f\u514d\u91cd\u590d\u5339\u914d\uff1f<\/strong><br \/>\u4e3a\u4e86\u907f\u514d\u5728\u5faa\u73af\u67e5\u627e\u4e2d\u91cd\u590d\u5339\u914d\u76f8\u540c\u7684\u5173\u952e\u5b57\uff0c\u53ef\u4ee5\u5728\u627e\u5230\u5339\u914d\u540e\uff0c\u66f4\u65b0\u5faa\u73af\u7684\u8d77\u59cb\u4f4d\u7f6e\u3002\u901a\u8fc7\u4f7f\u7528<code>break<\/code>\u8bed\u53e5\u6216\u8c03\u6574\u5faa\u73af\u53d8\u91cf\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u8df3\u8fc7\u5df2\u5339\u914d\u7684\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">text = &quot;\u8fd9\u662f\u4e00\u4e2a\u793a\u4f8b\u6587\u672c\uff0c\u5305\u542b\u591a\u4e2a\u793a\u4f8b\u3002&quot;\nkeyword = &quot;\u793a\u4f8b&quot;\nstart = 0\n\nwhile start &lt; len(text):\n    start = text.find(keyword, start)\n    if start == -1:\n        break\n    print(f&quot;\u627e\u5230&#39;{keyword}&#39;\u5728\u4f4d\u7f6e: {start}&quot;)\n    start += len(keyword)  # \u66f4\u65b0\u8d77\u59cb\u4f4d\u7f6e\uff0c\u907f\u514d\u91cd\u590d\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5faa\u73af\u67e5\u627e\u6587\u672c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5faa\u73af\u7ed3\u6784\uff08\u5982for\u6216while\uff09\u4ee5\u53ca\u6587\u672c\u67e5\u627e\u65b9\u6cd5\uff08\u5982str.find( [&hellip;]","protected":false},"author":3,"featured_media":971053,"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\/971046"}],"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=971046"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/971046\/revisions"}],"predecessor-version":[{"id":971055,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/971046\/revisions\/971055"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/971053"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=971046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=971046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=971046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}