It’s unclear exactly how you want your snippet to look because you didn’t properly quote the XML of your example snippet, so here’s an example that does what you’re asking, which you can modify as you need:
<snippet>
<content><![CDATA[
<!-- id is ${1/./\u$0/g} -->
<div id="$1">$0</div>
]]></content>
<tabTrigger>test</tabTrigger>
<scope>text.html</scope>
</snippet>
The ${1/./\u$0/g}
in the HTML comment means:
This is a mirrored copy of the $1
that the user will enter in the div id
field; in this mirror copy match the regular expression .
(any character) and replace it with \u$0
(an upper-case version of the match), and do this for every possible regular expression match (g
).
More information on how this works is available in the page on snippets in the unofficial documentation.