【发布时间】:2014-04-07 06:43:46
【问题描述】:
我想在php中将<a></a>替换为[],
例如,如果我有:
This is sample test to say you <a href="nowhere/333" id="blabah" > help</a> and you can redirect me to <a href="dddd">answer</a>
我想把它换成
This is sample test to say you [help] and you can redirect me to [answer],
如何使用正则表达式在 php 中完成这项工作?
【问题讨论】:
-
严格回答:“不,因为 PCRE 是 finite-state machine”
-
使用这个:eval.in/133065
标签: php regex function dom output