title: sed remove '_ipx/xxx/' from "/_ipx/xxx/images/img.webp"
body: <p>Trying to figure out the regex command using <code>sed</code> to replace the <code>_ipx/xxx/</code> with nothing so the <code>src</code> ends up as just <code>images/logo.webp</code>.</p>
  <p>As an example if I have the following img tag in <code>index.html</code>:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;img src=&quot;/_ipx/w_253,f_webp,q_80/images/img.webp&quot;
  alt=&quot;Testing a Custom Component&quot;
  sizes=&quot;(max-width: 640px) 100vw, 33vw&quot;
  srcset=&quot;/_ipx/w_640,f_webp,q_80/images/img.webp 640w, /_ipx/w_253,f_webp,q_80/images/img.webp 253w&quot; /&gt;
  </code></pre>
  <p>I want the sed to replace it to be:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;img src=&quot;/images/img.webp&quot;
  alt=&quot;Testing a Custom Component&quot;
  sizes=&quot;(max-width: 640px) 100vw, 33vw&quot;
  srcset=&quot;/images/img.webp 640w, /images/img.webp 253w&quot; /&gt;
  </code></pre>
  <p>According to <a href="https://regex101.com" rel="nofollow noreferrer">https://regex101.com</a> I think the following should do it: <code>/_ipx\/.+?\//gi</code> however when I try using it, nothing happens:
  <code>sed -i '' -e 's/_ipx\/.+?\//test/gi' index.html</code></p>