fork(3) download
  1. <?php
  2. $s = 'Monk #7.11';
  3. $p = '/^([^#]+\s)#(\d+)\.(\d+)$/e';
  4. $r = 'sprintf("%sS%02dE%02d", "$1", "$2", "$3")';
  5. echo preg_replace($p, $r, $s);
  6. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Monk S07E11