In ocamllex, I can use _ as a rule, lexer to match any string that does not match the previously defined rules, and causes errors. How to achieve this in lex / flex?
_
Typically, you should define a rule like this that will go at the very end:
.|\n { /* process default here */ }
This rule will match any character that did not match any other rule.
Hope this helps!