Helo,
I've this RegEx to delete double letter on a string :
<?
$string = "Heeeeelloo";
echo preg_replace( '`(.*)\1`', '$1',$string)."\n";
The current result is : Heeelo
But i would like this result : Helo
What's wrong ? Thanks
Helo,
I've this RegEx to delete double letter on a string :
<?
$string = "Heeeeelloo";
echo preg_replace( '`(.*)\1`', '$1',$string)."\n";
The current result is : Heeelo
But i would like this result : Helo
What's wrong ? Thanks
Just do:
preg_replace( '`(.)\1+`', '$1',$string);