<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lex(self, text):
 """Iterator that tokenizes `text` and yields up tokens as they are found"""

        for match in self.regex.finditer(text):
            name = match.lastgroup
            yield (name, match.group(name))