re结构上部分
import re
str1 = ‘I Stady Python3.6 Everyday’
print(-------------------match------------------)
m1 = re.match(r’i’, str1)
m2 = re.match(r’\w’, str1)
m3 = re.match(r’.‘, str1)
m4 = re.match(r’\D’, str1)
m5 = re.match(r’I’, str1.re.I)
m6 = re.match(r’\s’, str1)
print(m6.group())
print(---------------------search----------------)
s1 = re.search(r’stary’, str1)
s2 = re.search(r’S\w+', str1)
s3 = re.search(r’P\w+.\d, str1)
print(s3.group())
print(------------