以下幾點可能有助於解決問題:
如果你在模式的開頭加入 (?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