python - 正则表达式\Z(?ms)

标签 python regex

\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/

相关文章:

Python- Pandas 按列值的升序减去列值

ruby - 为什么自由间距模式会阻止负面回顾工作?

arrays - perl中如何以数组形式保存数据?

python - 如何从 df.groupby 绘制堆积条形图 ('feature' ) ['label' ].value_counts()

python - Seaborn 箱线图单个箱间距

python - 在 python 中导入 MySQLdb 时出错

python - 图像帧的强度值在转换为视频后发生变化

php - 如何解析 PHP 中特定分隔部分的字符串?

python - 在 Python 中分隔字符串,排除一些包含分隔符的元素

regex - apache camel s3 组件 - 在前缀上指定后缀/正则表达式