def match(self, pattern):
"""
Return the match obtained by searching @pattern.
The current `position` will advance as many characters as the match's
length.
@pattern
A regular expression.
"""
m = re.compile(pattern).match(self.source, self.position)
if m:
self.position += m.end() - m.start()
return m
return
评论列表
文章目录