There's another popular library that escapes me, too.
For his example, it needs one more line:
simple = Scan( IDENTIFIER = r'[\w_]\w*', OPERATOR = r'[-+\*=]', DIGIT = r'\d+(\.\d+)?', END_STATEMENT = r';', SPACE = r'\s+', ) simple.ignore('SPACE') simple('foo = 5 * 30; bar = bar - 60;') # generates tokens.
There's another popular library that escapes me, too.