如何在 3 个重音符之间匹配降价块代码

how to match markdown block code between 3 grave accent

 ``` 
  block code 
  word1
  word2
 ```

word without grave accent and it is will match it too

 ```
  another block code
  word1
  word2
  - it's will match it as part of the first block code
 ```

"""
some text after the grave accent text
word1
word2
"""`
0: "``` \nblock code\nword1\nword2\n```\n\nword without grave accent and it's will match it too\n\n```\nanother block code\nword1\nword2\n- it's will match it as part of the first block code\n```"
length: 1
0: "``` \nblock code\nword1\nword2\n```"
1: "```\nanother block code\nword1\nword2\n- it's will match it as part of the first block code\n```"
length: 2

您需要懒惰地匹配您的 + 量词:(\`{3}[\w|\W]+?\`{3})
+? 将尝试用尽可能少的字符匹配一次或多次,确保它不会贪婪地占用 \`{3} 之间的所有内容。量词默认是贪心的。

regex101 example

这里有一些 more reading 懒惰与贪婪的对比。