fork(9) download
  1. <?php
  2.  
  3. $str = 'text abcd text text efgh';
  4. echo preg_replace('~(.*)text~su', '${1}bar', $str);
Success #stdin #stdout 0.02s 23612KB
stdin
Standard input is empty
stdout
text abcd text bar efgh