fork download
  1. <?php
  2.  
  3. $orig = '/catalog/shassi/product/view/28/152.html';
  4.  
  5. $replaced = preg_replace('/catalog\/.+\/product/', 'catalog/product', $orig);
  6.  
  7. echo $replaced;
  8.  
Success #stdin #stdout 0.02s 23964KB
stdin
Standard input is empty
stdout
/catalog/product/view/28/152.html