使用python来做正则表达式:
import re
txt = "That will be 60 dollars and the weight is 50 pounds"
#Find all digit characters:
x = re.findall("\d", txt)
print(x)
这个使用了 \ 这个character, 这个character的意思:Signals a special sequence (can also be used to escape special characters).
结果如下:

如果觉得不错,就点赞或者关注或者留言~~
谢谢~
本文介绍如何使用Python进行正则表达式的操作,通过实例演示了如何查找字符串中的所有数字字符,并解释了特殊字符的作用。

2万+

被折叠的 条评论
为什么被折叠?



