使用python来做正则表达式
import re
txt = 'It is rainy outside.'
#Find all lower and upper case characters alphabetically between "a (A)" and "z(Z)":
x = re.findall('[a-z, A-Z]', txt)
print(x)
#Find all lower case characters alphabetically between "a" and "z":
y = re.findall('[a-z]', txt)
print(y)
代码中使用的[ ] 符合意思是表示a set of characters。
结果如下:
如果觉得不错,就点赞或者关注~~
谢谢~ ~