以下几点可能对您有帮助:
如果您在模式开头包含 (?s),它会告诉 Python 的正则表达式引擎让点号(.)也匹配换行符——从而允许 . 跨多行匹配。
我们目前正在修复一些与这些更改应用方式相关的错误。因此,如果上述建议没有帮助,请留意 2.8.18 版本,它可能会解决这个问题。
A couple of things that might help:
If you include (?s) at the beginning of the pattern, it tells Python's regular expression engine to make the dot (.) match newline characters as well—allowing . to match across multiple lines.
We are currently working on some bug fixes which relate to how these changes are applied. So if the suggestion above doesn't help, then look out 2.8.18 which might solve it.
机器翻译自 English