使用python来做正则表达式:
import re
txt = "0000 234324 2423 swer"
#Check if the string has any digits:
x = re.findall("[0-9]", txt)
print(x)
if x:
print("Yes, there is at least one match!")
else:
print("No match")
字符[0-9]: Returns a match for any digit between 0 and 9
结果如下:
如果觉得不错,就点赞或者关注或者留言~
谢谢~