My regex doesn't recognize arabic character
<p>I want to stop repeating of a character more than 3 times, to transform it to juste 3 times.</p>

<p>Example : aaaaaaaaaall  => aaall</p>

<p>So, I did it with english character, and it worked :</p>

<pre><code>$patternReplace = '/(.)\1{3,}/i';
$chaine = preg_replace($patternReplace, "$1$1$1", $chaine, -1 );
</code></pre>

<p>but it doesnt work for arabic character, like : </p>

<pre><code>أأأأأأأأأأأأأأأأأأأأأأأأأأأأ
</code></pre>

<p>thanx for help</p>