\Z(?ms)
在正则表达式中是什么意思?
\Z
是字符串结尾,但是 (?ms)
部分是什么?
这由 fnmatch.translate("abc")
添加到返回的正则表达式中。
最佳答案
来自 the docs :
(?iLmsux)
(One or more letters from the set 'i', 'L', 'm', 's', 'u', 'x'.) The group matches the empty string; the letters set the corresponding flags: re.I (ignore case), re.L (locale dependent), re.M (multi-line), re.S (dot matches all), re.U (Unicode dependent), and re.X (verbose), for the entire regular expression. (The flags are described in Module Contents.) This is useful if you wish to include the flags as part of the regular expression, instead of passing a flag argument to the re.compile() function.
关于python - 正则表达式\Z(?ms),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11998613/