Simple and flexible lexer