如何在 Python 正则表达式中使用通配符?
pythonserver side programmingprogramming更新于 2025/7/9 14:36:17
以下代码使用 Python 正则表达式 .() 点字符作为通配符,代表换行符以外的任何字符。
示例
import re
rex = re.compile('th.s')
l = "this, thus, just, then"
print rex.findall(l)
输出
这给出了输出
['this', 'thus']
相关文章
有用资源
python 参考教程 - 该教程包含有关 python 的更多信息:https://www.cainiaomax.com/python/

