fork download
  1. <?php
  2.  
  3. $text = "Есть текст, где много красивых слов, словосочетаний и не только <a href=\"http://google.com/\" > слов </a>.";
  4. echo preg_replace("/<a\b[^>]*>[^<]*<\/a>(*SKIP)(*F)|слов/iu","букв",$text);
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Есть текст, где много красивых букв, буквосочетаний и не только <a href="http://google.com/" > слов </a>.