DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(flex.info.gz) How do I match any string not matched in the preceding rules?

Info Catalog (flex.info.gz) How can I build a two-pass scanner? (flex.info.gz) FAQ (flex.info.gz) I am trying to port code from AT&T lex that uses yysptr and yysbuf
 
 How do I match any string not matched in the preceding rules?
 =============================================================
 
 One way to assign precedence, is to place the more specific rules
 first. If two rules would match the same input (same sequence of
 characters) then the first rule listed in the `flex' input wins, e.g.,
 
 
      %%
      foo[a-zA-Z_]+    return FOO_ID;
      bar[a-zA-Z_]+    return BAR_ID;
      [a-zA-Z_]+       return GENERIC_ID;
 
    Note that the rule `[a-zA-Z_]+' must come *after* the others.  It
 will match the same amount of text as the more specific rules, and in
 that case the `flex' scanner will pick the first rule listed in your
 scanner as the one to match.
 
Info Catalog (flex.info.gz) How can I build a two-pass scanner? (flex.info.gz) FAQ (flex.info.gz) I am trying to port code from AT&T lex that uses yysptr and yysbuf
automatically generated byinfo2html