fork download
  1. <?php
  2.  
  3.  
  4. $text = "оишщеок екщ жи укгрпжып а зделал то,то:павш!Папвпв";
  5.  
  6. $text = preg_replace('/[,](\\S)/ui', ', $1', $text);
  7. $text = preg_replace('/[;](\\S)/ui', '; $1', $text);
  8. $text = preg_replace('/[!](\\S)/ui', '! $1', $text);
  9. $text = preg_replace('/[?](\\S)/ui', '? $1', $text);
  10. $text = preg_replace('/[:](\\S)/ui', ': $1', $text);
  11.  
  12. $text = preg_replace('/жы/ui','жи', $text);
  13. $text = preg_replace('/шы/ui','ши', $text);
  14.  
  15. $text = preg_replace('/координально/ui','кардинально', $text);
  16. $text = preg_replace('/сдесь/ui','здесь', $text);
  17.  
  18. $text = preg_replace('/зделал/ui','сделал', $text);
  19. $text = preg_replace('/зделаю/ui','сделаю', $text);
  20. $text = preg_replace('/зделан/ui','сделан', $text);
  21.  
  22. $text = preg_replace('/(\\S) а /', '$1, а ', $text);
  23.  
  24. echo $text;
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
оишщеок екщ жи укгрпжип, а сделал то, то: павш! Папвпв