I am trying to convert any occurrence of a word with 3 chars or less to the same word with the string VVV attached to it.
Example: for -> forVVV
I am using none Latin chars (UTF8), hence the MB.
What I have is:
$pattern='\b[.{1,6}]\b';
$text=mb_ereg_replace($pattern,'\0VVV',$text,'me');
What am I missing?
Here is a case study, see it catches nothing:
$text="א אב אבי אביהו מדינה שול של";
$pattern='/\b.{1,6}\b/um';
$text=preg_replace($pattern,'hhh',$text);
echo $text;