1.?的作用
(1)re.compile(r’Bat(wo)man) ###表示可选
(2)re.compile(r’(ha){3,5}? ###表示非贪心
2.区分match对象的groups()、group()、group(1)……
m = re.match(r"(\d+).(\d+)", “25.32”)
m.groups()
(‘25’, ‘32’)
m.group(1)
‘25’
m.group()
‘25.32’
3.有点难,我再理解一下
1.?的作用
(1)re.compile(r’Bat(wo)man) ###表示可选
(2)re.compile(r’(ha){3,5}? ###表示非贪心
2.区分match对象的groups()、group()、group(1)……
m = re.match(r"(\d+).(\d+)", “25.32”)
m.groups()
(‘25’, ‘32’)
m.group(1)
‘25’
m.group()
‘25.32’
3.有点难,我再理解一下