fork(1) download
  1. <?php
  2.  
  3. $re = '/^(THIS)\b\s*(.*)/s';
  4. $str = 'THIS the rest of the string';
  5. $result = preg_replace($re, '$2 $1', $str);
  6. echo $result;
Success #stdin #stdout 0s 82624KB
stdin
Standard input is empty
stdout
the rest of the string THIS