Only part of matched string in flex in yytext
问题 I'm a newbie but I would like to know if I can, with flex, parse something with regex in a way yytext would only be part of the matched sequence. For example: @abcd{efgh, . I would like to match abcd once and use it then efgh, but I need to use the @ and the { to match them. Is this possible or do I have to process it entirely later in C? 回答1: You can use following context with the '/' operator. For eaxmple, abcd/efgh will match the string "abcd" only if its followed by "efgh", with the