preg_replace on html和diacritics

时间:2013-07-01 10:26:58

标签: php html preg-replace diacritics

无论如何都要用preg_replace做:

<p style="background:white">
<span style="font-size:10.0pt;font-family:&quot;Trebuchet MS&quot;,&quot;sans-serif&quot;">
Coût de la prestation : 43.19 . <u></u><u></u></span></p>

我只想删除或留下空格的价格。我不知道如何定义模式和替换表达式。

希望有人帮助我!

TY。

编辑:我只想删除43.19。,只是Coûtdela prestation:

2 个答案:

答案 0 :(得分:1)

您是否尝试过u modifier

类似的东西:

preg_replace('/Coût de la prestation : (\d+\.\d{2})/u', 'whatever', $str);

答案 1 :(得分:0)

最后有效的是:

preg_replace('#(Coût\s+de\s+la\s+prestation)\s*:\s*\d+(\.\d+)?#u', '$1:', $body);

感谢所有人。