fork(2) download
  1. <?php
  2.  
  3. $re = '/(@)|(?!^)\G\w/';
  4. $str = "email@xyz.com";
  5. $subst = "$1x";
  6. echo $result = preg_replace($re, $subst, $str);
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
email@xxxx.com