【发布时间】:2018-11-03 09:29:18
【问题描述】:
我在 Python 3.6.5 中遇到了 re 模块的问题。
我的正则表达式中有这种模式:
'\\nRevision: (\d+)\\n'
但是当我运行它时,我得到了一个DeprecationWarning。
我搜索了the problem on SO,但实际上并没有找到答案——我应该使用什么来代替\d+?只是[0-9]+ 还是别的什么?
【问题讨论】:
-
应该没问题,提供更多代码?
-
双重转义
\d或使用r'\\nRevision: (\d+)\\n'?
标签: python regex python-3.x