title: Regular expression/Replace method Javascript
body: <p>I want the pattern to be the following</p>
  
  <pre><code>var pattern = /[%25]+/g;//It matches against any encoded percent sign
  url = url.replace(pattern,'%');//Replace with only a percent sign
  </code></pre>
  
  <p>Problem is that it also recongnizes pattern such as <strong>%2</strong> which it should not do, it should only recognize <strong>%25</strong></p>
  
  <p>As it is now it interfers with my encoded space signs (<strong>%20</strong>) <a href="http://www.w3schools.com/tags/ref_urlencode.asp" rel="nofollow">http://www.w3schools.com/tags/ref_urlencode.asp</a></p>
  
  <p>Do you have a solution to my problem?</p>
  
  <p>Thanks in advance.</p>