<?php
// Grammar Nazi v2
$text = "Не здеся а Сдесь. Жы шы пиши с буквой и. Координально зделал но не там. Но зделал!Нетжы зделан";
$regExp = [
"/(ж|ш)ы/ui" => "$1и",
"/(к)(оо)(рдинально)/ui" => "$1а$3",
"/с(десь)/u" => "з$1",
"/з(дел(ал|аю|ан))/ui" => "с$1",
"/([.,:;!?])(\S)/ui" => "$1 $2",
"/(([^,]) а)/u" => "$1,",
"/(([^,]) но)/u" => "$1,"
];
foreach ($regExp as $key => $value){
}
echo $text;
PD9waHAKCi8vIEdyYW1tYXIgTmF6aSB2MgplcnJvcl9yZXBvcnRpbmcoLTEpOwptYl9pbnRlcm5hbF9lbmNvZGluZygndXRmLTgnKTsKCiR0ZXh0ID0gItCd0LUg0LfQtNC10YHRjyDQsCDQodC00LXRgdGMLiDQltGLINGI0Ysg0L/QuNGI0Lgg0YEg0LHRg9C60LLQvtC5INC4LiDQmtC+0L7RgNC00LjQvdCw0LvRjNC90L4g0LfQtNC10LvQsNC7INC90L4g0L3QtSDRgtCw0LwuINCd0L4g0LfQtNC10LvQsNC7IdCd0LXRgtC20Ysg0LfQtNC10LvQsNC9IjsKJHJlZ0V4cCA9IFsKCSIvKNC2fNGIKdGLL3VpIiA9PiAiJDHQuCIsCgkiLyjQuiko0L7Qviko0YDQtNC40L3QsNC70YzQvdC+KS91aSIgPT4gIiQx0LAkMyIsCgkiL9GBKNC00LXRgdGMKS91IiA9PiAi0LckMSIsCgkiL9C3KNC00LXQuyjQsNC7fNCw0Y580LDQvSkpL3VpIiA9PiAi0YEkMSIsCgkiLyhbLiw6OyE/XSkoXFMpL3VpIiA9PiAiJDEgJDIiLAoJIi8oKFteLF0pINCwKS91IiA9PiAiJDEsIiwKCSIvKChbXixdKSDQvdC+KS91IiA9PiAiJDEsIgoJXTsKCgpmb3JlYWNoICgkcmVnRXhwIGFzICRrZXkgPT4gJHZhbHVlKXsKCSR0ZXh0ID0gcHJlZ19yZXBsYWNlKCRrZXksJHZhbHVlLCR0ZXh0KTsKfQoKZWNobyAkdGV4dDs=