I use flex to work on a scanner to replace \" with "; and \\ with \.
so my code is like
%%
\\" \";
\\\ \\;
but when I compile, I get an error message like missing quote.
I think it’s the right regular expression, did I get wrong or it’s something special with flex?
You should escape both the
\AND"character. In order to match\"you use\\\"not\\". To match\\you use\\\\not\\\.Another thing is that flex matches a regexp and then execute the C code you placed in the associated action. Your example doesn’t look like correct flex statements.