title: for the Google re2 library, what does longest_match mean?
body: <p>I can't figure out what the longest_match option does in Google's re2 library.</p>
  
  <p>Explanations which are <em>incorrect</em>:</p>
  
  <ul>
  <li><p>when applying <code>/a*/</code> to <code>"aaaaa"</code>, setting longest-match makes the Kleene closure greedy so that the regex matches the whole string <code>"aaaaa"</code> instead of the empty string <code>""</code>.</p></li>
  <li><p>when applying <code>/a*/</code> to <code>"abaa"</code>, setting longest-match makes the regex match the longest match <code>"aa"</code> (starting at index 2) instead of the leftmost match <code>"a"</code> (starting at index 0)</p></li>
  </ul>
  
  <p>I haven't been able to find anyone on the internet who discusses this, which suggests that I'm the only one confused.  Can anyone help me out?</p>