<?php
$input = <<<EOF
МУУ ГООУО ОПП по Удмyртcкой Oбласти объявляет
конкурс на пocтaвку кaнцелярских товаров
на сумму 100500 руб. Sаmple.
EOF ;
"wordChecker" => "/\b(([А-ЯЁа-яё]+)([AaBCcEeHKMOoPpTy]+))+([А-ЯЁа-яё]*)/u" ,
"symbolChecker" => "/(([А-ЯЁа-яё]+)([AaBCcEeHKMOoPpTy]+))/u" ,
) ,
"wordChecker" => "/\b(([A-Za-z]+)([АаВСсЕеНКМОоРрТу]+))+([A-Za-z]*)/u" ,
"symbolChecker" => "/(([A-Za-z]+)([АаВСсЕеНКМОоРрТу]+))/u" ,
) ,
) ;
foreach ( $regexp as $rule ) {
foreach ( $matchWord [ 0 ] as $index => $wrongWord ) {
echo "Опечатка в слове {$wrongWord} : " ;
$wrongWord = "" ;
foreach ( $matchSymbol [ 0 ] as $keyIndex => $key ) {
$wrongWord .= $matchSymbol [ 2 ] [ $keyIndex ] . "[" . $matchSymbol [ 3 ] [ $keyIndex ] . "]" ;
}
echo $wrongWord . $matchWord [ 4 ] [ $index ] . "\n " ;
}
}
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCiRpbnB1dCA9IDw8PEVPRgrQnNCj0KMg0JPQntCe0KPQniDQntCf0J8g0L/QviDQo9C00Lx50YDRgmPQutC+0LkgT9Cx0LvQsNGB0YLQuCDQvtCx0YrRj9Cy0LvRj9C10YIK0LrQvtC90LrRg9GA0YEg0L3QsCDQv29j0YJh0LLQutGDINC6YdC90YbQtdC70Y/RgNGB0LrQuNGFINGC0L7QstCw0YDQvtCyCtC90LAg0YHRg9C80LzRgyAxMDA1MDAg0YDRg9CxLiBT0LBtcGxlLgpFT0Y7CgokcmVnZXhwID0gYXJyYXkoCglhcnJheSgKCQkid29yZENoZWNrZXIiID0+ICIvXGIoKFvQkC3Qr9CB0LAt0Y/RkV0rKShbQWFCQ2NFZUhLTU9vUHBUeV0rKSkrKFvQkC3Qr9CB0LAt0Y/RkV0qKS91IiwK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