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

あなたが指摘したのは、置換用のフォーマットされた文字列です。文書化されているように、これらはSublimeTextスニペット置換の一部です-

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 に答える