122行和123行字符串只匹配了第一个
In [120]: ma = re.match(r'[A-Z][a-z]*','A')
In [121]: ma.group()
Out[121]: 'A'
In [122]: ma = re.match(r'[A-Z][a-z]*','JFjfdFK')
In [123]: ma.group()
Out[123]: 'J'
In [124]: ma.groups()
Out[124]: ()
In [120]: ma = re.match(r'[A-Z][a-z]*','A')
In [121]: ma.group()
Out[121]: 'A'
In [122]: ma = re.match(r'[A-Z][a-z]*','JFjfdFK')
In [123]: ma.group()
Out[123]: 'J'
In [124]: ma.groups()
Out[124]: ()
2018-08-24
举报