title: Regular Expression to match last word when string starts with pattern
body: <p>I'm trying to create a regex to match the last word of a string, but only if the string starts with a certain pattern.</p>
  
  <p>For example, I want to get the last word of a string only if the string starts with "The cat".</p>
  
  <ul>
  <li>"The cat eats butter" -> would match "butter". </li>
  <li>"The cat drinks milk"-> would match "milk" </li>
  <li>"The dog eats beef" -> would find no match.</li>
  </ul>
  
  <p>I know the following will give me the last word:</p>
  
  <pre><code>\s+\S*$
  </code></pre>
  
  <p>I also know that I can use a positive look behind to make sure a string starts with a certain pattern:</p>
  
  <pre><code>(?&lt;=The cat )
  </code></pre>
  
  <p>But I can't figure out to combine them.</p>
  
  <p>I'll be using this in c# and I know I could combine this with some string comparison operators but I'd like this all to be in one regex expression, as this is one of several regex pattern string that I'll be looping through.</p>
  
  <p>Any ideas?</p>