title: R Regex match the last occurance
body: <p>I've tried many things, but I'm still looking for a solution...</p>
  
  <p>I have some text:</p>
  
  <blockquote>
    <p>blah blah blah...\nSlide rule exam does not provoke
    symptoms.\nImPACT Test Date: ... (baseline done at school)\nVerbal
    Memory Composite\n98\n98%\nVisual Memory Composite\n81\n69%\nVisual
    Motor Speed Composite?38.83\n70%\nReaction Time\n0.59\n56%\nImpulse
    Control\n9\nTotal Symptom Score\n3\nImPACT Test Date: ...
    (post-injury done at school)\nVerbal Memory Composite\n54\n&lt;1%\nVisual
    Memory Composite\n35\n&lt;1%\nVisual Motor ... blah blah blah</p>
  </blockquote>
  
  <p>I would like to capture the last test score (in terms of sequence in the text) for the person. Right now I'm capturing the first (in terms of sequence in the text) test score.</p>
  
  <p>This code captures the first Verbal Memory Composite score, in this case 98 and 98 (percent). I would like to capture the last one, in this case 54 and 1 (percent).</p>
  
  <p>My current code:</p>
  
  <pre><code>re = ".*Verbal Memory Composite\n(\\S+?)\n(\\S+?)\n.*"
  concussion.notes$IMPACT_VERBAL_MEM_NEW = as.numeric.score(with(concussion.notes, ifelse(grepl(re,NOTE_TEXT),sub(re,'\\1',NOTE_TEXT),'')))
  concussion.notes$IMPACT_VERBAL_MEM_PCT_NEW = as.numeric.score(with(concussion.notes, ifelse(grepl(re,NOTE_TEXT),sub(re,'\\2',NOTE_TEXT),'')))
  </code></pre>
  
  <p>I tried gsub rather than sub, among other things, but still got 98. </p>