title: How to make flex try the second longest matching regular expression?
body: <p>This question might sound a little confusing.  I'm using Flex to pass tokens to Bison.  </p>
  
  <p>The behavior I want is that Flex matches the longest regular expression and passes that token (it DOES work like this), but if that token doesn't work with the grammar, it then matches the second longest regular expression and passes that token.  </p>
  
  <p>I'm struggling to think of a way to create this behavior.  How could I make this happen?</p>
  
  <p>To clarify, for example, say I have two rules:</p>
  
  <pre><code>"//"    return TOKEN_1;
  "///"   return TOKEN_2;
  </code></pre>
  
  <p>Given the string <code>"///"</code>, I'd like it to first pass <code>TOKEN_2</code> (it does).
  If <code>TOKEN_2</code> doesn't fit with the grammar as specified in Bison, it then passes <code>TOKEN_1</code> (which is also valid).</p>
  
  <p>How can I create this behavior? </p>