import re
ret1=re.match(".*\bver\b","ho ver abc")
print(ret1)
ret2=re.match(r".*\bver\b","ho ver abc")
print(ret2)
ret3=re.match(r".*\Bver\B","hoverabc").group()
print(ret3)
ret4=re.match(r".*\Bver\Bf>","h hj o0<bsverf>符abc").group()
print(ret4)
ret5=re.match("[1-9]?[0-9]","7")
ret6=re.match("[1-9]?[0-9]","33")
ret7=re.match("[1-9]?[0-9]","09")
print(ret5,ret6,ret7)
ret8=re.match("[1-9]?\d$|100","08")
print(ret8)
ret9=re.match("\w{4,20}@163.com","test@163.com")
print(ret9)
ret10=re.match("\w{4,20}@163|126|qq.com","test@163.com")
print(ret10)
None
<_sre.SRE_Match object; span=(0, 6), match='ho ver'>
hover
h hj o0<bsverf>
<_sre.SRE_Match object; span=(0, 1), match='7'> <_sre.SRE_Match object; span=(0, 2), match='33'> <_sre.SRE_Match object; span=(0, 1), match='0'>
None
<_sre.SRE_Match object; span=(0, 12), match='test@163.com'>
<_sre.SRE_Match object; span=(0, 8), match='test@163'>
ret=re.match("([^-]*-(\d+))","123-12345678")
print(ret.group(0))
print(ret.group(1))
print(ret.group(2))
ret=re.match("(([^-]*)-(\d+))","123-12345678")
print(ret.group(0))
print(ret.group(1))
print(ret.group(2))
print(ret.group(3))
ret=re.match("(([^-]*)-(\d+)-(\d+))","123-12345678-90")
print(ret.group(0))
print(ret.group(1))
print(ret.group(2))
print(ret.group(3))
print(ret.group(4))
123-12345678
123-12345678
12345678
123-12345678
123-12345678
123
12345678
123-12345678-90
123-12345678-90
123
12345678
90
str1="<html>qq</html>"
ret1=re.match(".>([a-z])<.*",str1)
print(ret1.group(1))
str1="<a><html>www.taobao.com</html></a>"
ret2=re.match("<.*>",str1)
print(ret2)
ret3=re.match("<.*?>",str1)
print(ret3)
ret4=re.match("<[a-z]*>",str1)
print(ret4)
ret2=re.match("(<.?>)(.?>)([a-z0-9A-Z.])(</.?>)(</.*?>)",str1)
print(ret2)
print(ret2.group(1))
print(ret2.group(2))
print(ret2.group(3))
print(ret2.group(4))
print(ret2.group(5))
qq
<_sre.SRE_Match object; span=(0, 34), match='<a><html>www.taobao.com</html></a>'>
<_sre.SRE_Match object; span=(0, 3), match='<a>'>
<_sre.SRE_Match object; span=(0, 3), match='<a>'>
<_sre.SRE_Match object; span=(0, 34), match='<a><html>www.taobao.com</html></a>'>
<a>
<html>
www.taobao.com
</html>
</a>
str1="<a><html>www.taobao.com</html></a>"
ret2=re.match("<.*>",str1)
str2='''Iraqi
Iraqian
miqra
qasida
qintar
qoph
zaqqum%'''
ret2 = re.findall(r"^q.*",str2,re.MULTILINE)
print(ret2)