<?php
$text = <<<END
И сказал он:уйди.И пробел не забудь поставить.
END;
$check1 = "!([\w\ \,]){10}(\,|\.)(\w)([\w\ \,]){10}!iu";
$check2 = "!([\w\ \,]){10}(ж|ш)ы([\w\ \,\(]){7}!iu";
$check3 = "!([\w\ \,]){10}расказ([\w\ \,\(]){7}!iu";
$check4 = "!([\w\ \,]){10}\b(но|а)\b([\w\ \,]){10}!iu";
$announce1 = "В этом месте пропущен пробел после запятой или точки: ";
$announce2 = "ЖИ\ШИ пиши с И:";
$announce3 = "РАССКАЗ пишется с двумя СС:";
$announce4 = "Перед союзами А и НО всегда ставится запятая:";
function detectErrors($text, $check, $announce) {
foreach ($i[0] as $key => $asd) {
echo "$announce *$asd*\n";
}
}
detectErrors($text, $check1, $announce1);
detectErrors($text, $check2, $announce2);
detectErrors($text, $check3, $announce3);
detectErrors($text, $check4, $announce4);
?>
PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoLTEpOwptYl9pbnRlcm5hbF9lbmNvZGluZygndXRmLTgnKTsKIAokdGV4dCA9IDw8PEVORArQmCDRgdC60LDQt9Cw0Lsg0L7QvTrRg9C50LTQuC7QmCDQv9GA0L7QsdC10Lsg0L3QtSDQt9Cw0LHRg9C00Ywg0L/QvtGB0YLQsNCy0LjRgtGMLgpFTkQ7CiAKJGNoZWNrMSA9ICIhKFtcd1wgXCxdKXsxMH0oXCx8XC4pKFx3KShbXHdcIFwsXSl7MTB9IWl1IjsKJGNoZWNrMiA9ICIhKFtcd1wgXCxdKXsxMH0o0LZ80Ygp0YsoW1x3XCBcLFwoXSl7N30haXUiOwokY2hlY2szID0gIiEoW1x3XCBcLF0pezEwfdGA0LDRgdC60LDQtyhbXHdcIFwsXChdKXs3fSFpdSI7CiRjaGVjazQgPSAiIShbXHdcIFwsXSl7MTB9XGIo0L3QvnzQsClcYihbXHdcIFwsXSl7MTB9IWl1IjsKJGFubm91bmNlMSA9ICLQkiDRjdGC0L7QvCDQvNC10YHRgtC1INC/0YDQvtC/0YP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