【发布时间】:2016-05-01 11:21:56
【问题描述】:
我目前正在开发自己的模板引擎用于教育目的。
现在,如果字符串包含以下内容,我会卡在我想要匹配的部分,例如:
$article.author
到目前为止,这是我的正则表达式模式: http://www.phpliveregex.com/p/fx2
当前模式匹配两者
{$article.author}
和$article.author。
但它应该只匹配$article.author。
Jumpy,任何帮助将不胜感激。
【问题讨论】:
-
使用这个:-
^\$[^\|{}]*$
标签: php regex template-engine