fork(1) download
  1. <?php
  2.  
  3. $str = "Ok!!!\nReally????\nI guess.....";
  4. $res = preg_replace('/([?!.])\1+/', '$1', $str);
  5. echo $res;
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Ok!
Really?
I guess.