title: Get last match with Boost::Regex
body: <p>I have a regular expression in C++ with Boost which matches lines in multi-line strings. Regex search finds the first match, however I'm interested in the last line which matches.</p>
  
  <p>The code I'm using now is something like this:</p>
  
  <pre><code>matched = boost::regex_search(input, results, regex);               
  if (!matched) {
      return -1; // error code
  }
  matched_string = results["Group"]; 
  </code></pre>
  
  <p>If <code>regex</code> was <code>"(?&lt;Group&gt;Data.)"</code> and <code>input</code> was <code>"Data1 Data2 Data3"</code>, then <code>matched_string</code> is now <code>"Data1"</code>. I want it to be <code>"Data3"</code>.</p>