title: Replace values between url using regEx
body: <p>Hi I've been trying to find and replace width &amp; height of an image using the following url</p>
  
  <p><a href="http://res.cloudinary.com/chathura-rupasinghe/image/upload/c_fill,h_1024,w_768/v1453555296/manhattan_stater.jpg" rel="nofollow">http://res.cloudinary.com/chathura-rupasinghe/image/upload/c_fill,h_1024,w_768/v1453555296/manhattan_stater.jpg</a></p>
  
  <p>as you notice h_1024,w_768  tells how the image should be scaled when i request from the cdn. according to my requirement this should be changeable via script ex resize(url,{500,500}) should be convert following url to</p>
  
  <p><a href="http://res.cloudinary.com/chathura-rupasinghe/image/upload/c_fill,h_500,w_500/v1453555296/manhattan_stater.jpg" rel="nofollow">http://res.cloudinary.com/chathura-rupasinghe/image/upload/c_fill,h_500,w_500/v1453555296/manhattan_stater.jpg</a></p>
  
  <p>this is my code so far it's not perfect is there any way that could resolve this problem  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var url = "http://res.cloudinary.com/chathura-rupasinghe/image/upload/c_fill,h_1024,w_768/v1453555296/manhattan_stater.jpg";
  
  
  
  var reg1 = /(\h_.*?\,)/gi;
  
  
   url = url.replace(reg1,"h_500,");
  
  console.log(url);</code></pre>
  </div>
  </div>
  </p>