I have been trying to build a regex which can capture:
but not to capture pure numbers such as:
Any help is appreciated!
try this
import re
>>> if(re.match(".*[a-z].*",'abc123')):
print "1"
1
>>> if(re.match(".*[a-z].*",'123')):
print "1"
>>> if(re.match(".*[a-z].*",'123abc')):
print "1"
1
您可能正在寻找这个: \\d*[a-zA-Z]+\\d*[a-zA-Z]*
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.