title: PHP preg_replace URL pattern
body: <p>I have the following URL structure:</p>
  
  <pre><code>http://website.com/images/folder1/folder2/123456/x500x1000_2x_ImageName.jpg
  </code></pre>
  
  <p>I need to remove the crop resolution "x500x1000_2x_" from the image name, like so:</p>
  
  <pre><code>http://website.com/uploads/folder1/folder2/123456/ImageName.jpg
  </code></pre>
  
  <p>I tried numerous things:</p>
  
  <pre><code>$img = preg_replace('/\[x](\d+)[x](\d+)[_2x_]\.*/', '', $img);
  $img = preg_replace('/[x]\d[x]\d[_2x_]\.*/', '', $img);
  $img = preg_replace('/\/\[x]+\d+[x]+\d+\D+\d\.*/', '', $img);
  </code></pre>
  
  <p>I am really not good with preg_replace, can anyone help me please?</p>