<?php

$regexp = "/[,]\S/mu";
$regexp1 = "/[Жж|Шш][Ыы]/mu";
$regexp2 = "/Здеся|тама|тута|сдесь/mu";
$regexp3 = "/[;]\S/mu";
$regexp4 = "/[^,\w]а/mu";

$text = "Иллидан,жыви! Жыве Беларусь! Я,О;рк. Тама, тута, здеся, тебя кто так говорить научил? ШЫРОКА ШЫРОКА! Не нищий а свободный.";

preg_match_all($regexp, $text, $wrong);

/* preg_match_all($regexp1, $text, $wrong);
preg_match_all($regexp2, $text, $wrong);
preg_match_all($regexp3, $text, $wrong);
preg_match_all($regexp4, $text, $wrong);*/

 


foreach ($wrong as $w) {
	echo "Нет пробела \n";
	print_r($w);
	$a = preg_replace($regexp, "$1 ", $text);
	echo " Исправленный вариант \n";
	echo $a;
}

