<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def match(self, pattern):
 """Perform regex match at index."""


        m = pattern.match(self._string, self._index)
        if m:
            self._index = m.end()
        return m