Finally what worked was:
preg_replace('#(Coût\s+de\s+la\s+prestation)\s*:\s*\d+(\.\d+)?#u', '$1:', $body);
Thanks to all.
Domanda
Is there anyway to do preg_replace with that:
<p style="background:white">
<span style="font-size:10.0pt;font-family:"Trebuchet MS","sans-serif"">
Coût de la prestation : 43.19 . <u></u><u></u></span></p>
I just want to remove or leave with spaces the price. I don't know how to define the pattern and the replacement expressions.
Hope anyone helps me!
TY.
EDIT: I just want to remove the 43.19 ., being just Coût de la prestation :
Soluzione 2
Finally what worked was:
preg_replace('#(Coût\s+de\s+la\s+prestation)\s*:\s*\d+(\.\d+)?#u', '$1:', $body);
Thanks to all.
Altri suggerimenti
Did you try the u
modifier?
Something like:
preg_replace('/Coût de la prestation : (\d+\.\d{2})/u', 'whatever', $str);