fork download
  1. <?php
  2.  
  3. $regex = "/(?!<.*?)([\\p{Cyrillic}]+)(?![^<>]*?\\>)/umi";
  4. $strng = "bar foo <p> barfoo </p> foobar ОртоЦентр bar bar\n";
  5. $subst = '<a href="http://f...content-available-to-author-only...o.bar">$1</a>';
  6. $limit = '-1';
  7.  
  8. $result = preg_replace($regex, $subst, $strng, $limit);
  9.  
  10. echo $result;
  11.  
  12. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
bar foo <p> barfoo </p> foobar <a href="http://f...content-available-to-author-only...o.bar">ОртоЦентр</a> bar bar