php regex [b]到< b> [英] php regex [b] to <b>
问题描述
"'\[b\](.*?)\[/b\]'is",
我当前的RegEx是否正常工作.但是我想将[]改为<>.但这是行不通的……我还需要更改[].
Is my current RegEx working. But I want to change the [] to be <> instead. But it doesn't work... What more then just the [] do I need to change.
推荐答案
有
这使您可以轻松地手动定义替换规则: which allows you to simply define your replacement rules by hand: 还要检查有关BBCode解析器的各种类似问题: Also check the various similar questions about BBCode Parsers: 这篇关于php regex [b]到< b>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!echo bbcode_parse(
bbcode_create(
array(
'b' => array(
'type' => BBCODE_TYPE_NOARG,
'open_tag' => '<b>',
'close_tag' => '</b>'
)
)
),
'[b]Bold Text[/b]'
);
// prints <b>Bold Text</b>