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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With