fork(1) download
  1. <?php
  2.  
  3. $str = array(
  4. '<img alt="test" src="http://w...content-available-to-author-only...n.com/t/img.png" title="test title" />',
  5. '<img src="http://w...content-available-to-author-only...n.com/img.png">',
  6. '<img src="http://w...content-available-to-author-only...n.com/t/53538/ezgze4/img.png" />',
  7. '<img alt="test" src="someimg.png" style="blah" title="test title" />',
  8. );
  9.  
  10. foreach($str as $t) {
  11. echo preg_replace('/<img.*src="http:\/\/www.theblacklisteddomain.com(.*?)".*\/?>/', 'replaced', $t) . PHP_EOL;
  12. }
  13. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
replaced
replaced
replaced
<img alt="test" src="someimg.png" style="blah" title="test title" />