i use such regex $msg = preg_replace('/<b>(\w)<\/b>/', '9999', $msg);
to replace <b>test</b>
but it not replace. why?
php正则表达式奇怪的错误
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- duanhan9334 2011-04-06 13:13关注
Notice the plus after \w+
$msg = preg_replace('/<b>(\w+)<\/b>/', '9999', $msg);
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报