【发布时间】:2015-01-11 13:58:54
【问题描述】:
我正在为 Coda 更新旧的 Twig 模式。 Coda 使用大部分 SubEthaEdit 格式进行语法着色。
但我不太擅长正则表达式,我只是在学习 SubEthaEdit 的格式。另外,Panic 还没有记录 Coda 对该格式的使用。
所以...
我从简单的开始着手研究这个结构:
{% block header %}
我选择了{% 和%}:
<keywords id="Template Tag" scope="markup.tag.framework" useforautocomplete="yes">
<regex>({%|%})</regex>
</keywords>
我选择了block:
<keywords id="Template Tags" scope="keyword.control" useforautocomplete="yes">
<string>block</string>
</keywords>
然后我尝试了:
<keywords id="Variables in Twig" scope="markup.tag.attribute.name" useforautocomplete="no">
<regex>\w</regex>
</keywords>
获取head 或该行中使用的任何其他变量。但它什么都不匹配。
【问题讨论】:
标签: regex syntax-highlighting coda