title: Replacing characters after percent sign with regex
body: <p>I would like to use RegEx to replace all text that comes after the percent sign in a string.
  Let's say I have the following string:</p>
  
  <pre><code>/path/to/webpage/%foo
  </code></pre>
  
  <p>I would like to use RegEx to replace <code>%foo</code> (this is variable and doesn't necessarily contain foo at all times) with <code>$foo</code>.</p>
  
  <p>So far I have come up with the following expression, except this doesn't seem to work.</p>
  
  <pre><code>(%([a-z]+))\w
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>Thank you!</p>