我正在尝试使用正则表达式
(?<=@func_strtotime\().*[^\(](?=\))
匹配
+{{request.expires_in}} - 300
来自字符串
'Y-m-d H:i:s',@func_strtotime(+{{request.expires_in}} - 300),@func_time(1234)
但是正则表达式当前匹配的结果是
+{{request.expires_in}} - 300),@func_test(1234
如果有人可以更正我的正则表达式,我将不胜感激。
您的正则表达式过于贪婪。在?
之后添加.*
以使其变得懒惰:
(?<=@func_strtotime\().*?[^\(](?=\))