I want to use this regex (["'])(?:(?=(\?))\2.)*?\1 from this answer to this question
But when I use it in a lex input file as follows:
DOUBLEQUOTE_CONTENTS (["'])(?:(?=(\?))\2.)*?\1
%%
{DOUBLEQUOTE_CONTENTS} { printf("here"); }
I get a large number of "unrecognized character" errors from lex. It chokes on the first ? character and many more after that. If I escape the ? characters, the regex doesn't match anymore.
How can I use the said regex in a lex input file?