我想对两个花括号内第一次出现的字符进行匹配,但忽略其中的字符。
{{some text here {{nested text here}} another text {{another nested text here}} final text}}
所以结果一定是
some text here {{nested text here}} another text {{another nested text here}} final text
但是这个搜索
preg_match_all("^\{{(.*?)\}}^", $string, $results);
给我第一对括号内的那些:
$results[0][0] = nested text here
$results[0][1] = another nested text here
有没有办法用 preg_match_all 实现这一点?