repl regexp parsing with fsm