title: RegEx to Match Everything Up To And Including the Last Parentheses
body: <p>I have a string of text like this:</p>
  
  <blockquote>
    <p>Bob Smith (Approve) Request reviewed 4/27/2016 (Bob Smith) Have fun on your vacation!</p>
  </blockquote>
  
  <p>And I want to use a regular expression to match everything up to and including the last parentheses, which would be this:</p>
  
  <blockquote>
    <p>Bob Smith (Approve) Request reviewed 4/27/2016 (Bob Smith)</p>
  </blockquote>
  
  <p>I am eventually going to use this regular expression to replace the text up to and including the last parentheses with nothing, so that only the comment at the end is returned. (It would be easier to match on the part after the last parentheses [see below], but I am using a different approach based on a quirk in the program I'm using.)</p>
  
  <p>I found this question on SO that asks about how to find everything after the last forward slash: <a href="https://stackoverflow.com/questions/8945477/regular-expression-for-getting-everything-after-last-slash">Regular Expression for getting everything after last slash</a>. The answer is:</p>
  
  <pre><code>([^/]+$)
  </code></pre>
  
  <p>However, I need to modify that regular expression to find everything UP TO AND INCLUDING the last PARENTHESES. I tried to modify to this: </p>
  
  <pre><code>(^[^)]+) 
  </code></pre>
  
  <p>but that finds everything up to but NOT INCLUDING the FIRST parentheses.</p>
  
  <p>How can I change that to match everything up to and including the last parentheses?</p>
  
  <p>See this RegExr as an example: <a href="http://regexr.com/3dahe" rel="nofollow noreferrer">http://regexr.com/3dahe</a></p>