<?php
"/шы/ui" => "ши",
"/жы/ui" => "жи",
"/сдесь/ui" => "здесь",
"/здела(л|ю|н)/ui" => "сдела$1",
"/([,;!?:])(?! )/ui" => "$1 ",
"/(?<!(,))(\s(а|но)\b)/ui" => ",$2"
);
$text = "Все хорошо. Но могло бы быть лучше. Правда?";
echo $text . "\n";
foreach($mistakes as $key => $rule) {
}
echo $text;
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKJG1pc3Rha2VzID0gYXJyYXkgKAoJIi/RiNGLL3VpIiA9PiAi0YjQuCIsCiAgICAiL9C20YsvdWkiID0+ICLQttC4IiwKICAgICIv0YHQtNC10YHRjC91aSIgPT4gItC30LTQtdGB0YwiLAogICAgIi/Qt9C00LXQu9CwKNC7fNGOfNC9KS91aSIgPT4gItGB0LTQtdC70LAkMSIsCiAgICAiLyhbLDshPzpdKSg/ISApL3VpIiA9PiAiJDEgIiwKICAgICIvKD88ISgsKSkoXHMo0LB80L3QvilcYikvdWkiID0+ICIsJDIiCik7CiR0ZXh0ID0gItCS0YHQtSDRhdC+0YDQvtGI0L4uINCd0L4g0LzQvtCz0LvQviDQsdGLINCx0YvRgtGMINC70YPRh9GI0LUuINCf0YDQsNCy0LTQsD8iOwplY2hvICR0ZXh0IC4gIlxuIjsKZm9yZWFjaCgkbWlzdGFrZXMgYXMgJGtleSA9PiAkcnVsZSkgewogCSR0ZXh0ID0gcHJlZ19yZXBsYWNlKCRrZXksICRydWxlLCAkdGV4dCk7Cn0KZWNobyAkdGV4dDs=