【发布时间】:2011-08-28 08:53:06
【问题描述】:
我想知道这里的反向引用有什么问题:
preg_match_all('/__\((\'|")([^\1]+)\1/', "__('match this') . 'not this'", $matches);
它应该匹配 __('') 之间的字符串,但实际上它返回:
match this') . 'not this
有什么想法吗?
【问题讨论】:
-
后向引用真的在 char 类中有效吗?
-
对不起,有一个丢失\我已经更正了面糊
-
继续下一个解决方案。
标签: php regex preg-match-all backreference