How can you translate this into Regex: Replace any char (aka '.') that is repeating more than once and replace it with one of that char with the exception of "ii" and "iii".
$reg = preg_replace('/(.)/1{1,}/','', $string);
Now this must replace VVVVV
with V
or ....
with .
and must not replace Criiid
(or Criid
) but Criiiiiiid
with Crid
.
Feel free to comment if you don't understand the question.