fork(1) download
  1. <?php
  2. $s = 'text If you want this';
  3. echo preg_replace_callback("/(?<start>.*)(?<mid>If (I|you) want)(?<end>.*)/iu", function($m) {
  4. return $m['start'].'*'.$m['mid'].'*'.$m['end'];
  5. }, $s);
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
text *If you want* this