title: replace string url in certain path
body: <p>I have link to image</p>
  <pre><code>link = &quot;https://ecs7.sandal.net/img/cache/500-square/product-10/2019/6/16/719184/719184_de07958e-9e6b-491a-ae61-2291220be643_1080_1080.jpg&quot;
  </code></pre>
  <p>the path after /img/cache which is 500-square is the size of the image.</p>
  <p>the link is dynamic. but the size is alway after the cache/ path.</p>
  <p>and the rest of link after the size path is product folder, so it can be ignored.</p>
  <p>500-square is to small for image i want. so i have to change to 900 or some other size.</p>
  <p>so the link will be like this below</p>
  <pre><code>https://ecs7.sandal.net/img/cache/900/product-10/2019/6/16/719184/719184_de07958e-9e6b-491a-ae61-2291220be643_1080_1080.jpg
  </code></pre>
  <p>how to replace 500-square to 900 using ruby string ?</p>
  <p>thanks</p>