0
<snippet>
    <content><![CDATA[getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2')]]></content>
    <tabTrigger>get</tabTrigger>
    <scope>source.js</scope>
    <description>Get Elements</description>
</snippet>

我不知道这是什么意思。我明白$1,但是什么是(?1:agName)(?2:d) ???

4

1 回答 1

1

您指出的是用于替换的格式化字符串。它们是 Sublime Text 片段替换的一部分,如文档所述-

In addition to the place holder syntax, tab stops can specify more complex operations with substitutions. Use substitutions to dynamically generate text based on a mirrored tab stop.

The substitution syntax has the following syntaxes:

${var_name/regex/format_string/}
${var_name/regex/format_string/options}

因此,在您的代码段中,这些是替换 - ${1/(T)|.*/(?1:s)/}, ${1:T}, ${1/(T)|(I)|.*/(?1:agName)(?2:d)/}

于 2013-03-26T20:35:10.787 回答