考虑以下:
$string = "A string with {LABELS} and {more|232} {lbls} and some other stuff";
echo str_replace('/(\{.*?\})/', '', $string);
我正在尝试删除所有标签(标签是 之间的任何文本{brackets}
)。预期的输出是:
A string with and and some other stuff
但我得到的是原始字符串:
A string with {LABELS} and {more|232} {lbls} and some other stuff
我究竟做错了什么?