lightweight pure python regex-based lexer