I’ve tried:
and string_detect collect = parse
| '\"' { STRING collect }
| '\\'|'\''|'\"'|'\t'|'\n'|'\r'|'\b'|' ' as c { string_detect (collect^(String.make 1 c)) lexbuf }
(* | ['\\' '\"'] as s { string_detect (collect^ String.make 1 s) lexbuf } *)
| "\\\"" as s { string_detect (collect^s) lexbuf }
(* | "," as c { string_detect (collect^String.make 1 c) lexbuf } *)
| (alphanum | "_")* as s { string_detect (collect^s) lexbuf}
but nothing seems to work.
I want to match:
get_all_tokens "\\\"";;