I have the following string:
"Canal Capital(Canal Capital) Felipe Cano - Recursos Humanos - [email protected] - (Canal Capital) Andres Zapata - Tecnologías de la Información - [email protected] - 3212032851(Canal Capital) Miguel Cabo - Canal Capital - [email protected] - 457 83 00 Ext. 5227 301 734 07 56"
I want to be able to remove a repeating pattern inside the string, so if the pattern is (Canal Capital), I should end up with:
"Canal Capital Felipe Cano - Recursos Humanos - [email protected] - Andres Zapata - Tecnologías de la Información - [email protected] - 3212032851 Miguel Cabo - Canal Capital - [email protected] - 457 83 00 Ext. 5227 301 734 07 56"
So far I've tried this (It works if the pattern repeats itself only once):
$cadena = preg_replace("/\(.*\)/", "", $cadena);
But I get just the first "Canal Capital" part. Can I achieve my goal with regex ? Maybe there's a better way to accomplish this that I don't know about. Thanks.