使用python来做正则表达式:
import re
txt = "wer DE ase 12"
#Return a match at every no-digit character:
x = re.findall("\D", txt)
print('x 的结果:',x)
if x:
print("Yes, there is at least one match no-digit character!")
else:
print("No match")
txt_new = '23 234 2423 234'
y = re.findall("\D", txt_new)
print('y 的结果:',y)
text = '3432 24 234 2343 sdf'
z = re.findall('\D', text)
print('z 的结果:',z)
字符 \D: Returns a match where the string DOES NOT contain digits
结果如下:
如果觉得不错,就点赞或者关注或者留言~
谢谢~