我知道有很多关于同样问题的问题。我阅读了它们,但我无法修复我的代码。
<?
$tabla = "<table>
<tr>
<td>
<a class='texto'>$ 2,123.01</a>
</td>
<td>
asddasdsad$,.$$$
</td>
</tr>
</table>";
echo preg_replace("<a class='texto'>\$ ([0-9]*),([0-9]*).([0-9]*)</a>", "<a class='texto'>$0$1,$2</a>", $tabla);
?>
PHP 错误:警告:preg_replace() [function.preg-replace]: Unknown modifier '$'
我想得到:
<?
<table>
<tr>
<td>
<a class='texto'>2123,01</a>
</td>
<td>
asddasdsad$,.$$$
</td>
</tr>
</table>
?>
我在这里http://regexpal.com/尝试并测试了我的正则表达式并工作。但是我在 preg_replace 中有一些问题。