Instead of doing a simple replacement, you need a format string to your regex, as discussed in the snippets reference. So, your snippet should look like this:
<snippet>
<content><![CDATA[
get${1:User} ('$2', function(err, ${1/(.*)/\L\1\E/i}){$0});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>get</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.c</scope>
</snippet>
The regex matches all possible characters in variable $1
(except newlines) and replaces it with itself but formats it in all lowercase (\L
begins lowercasing, \1
is the first capture group, and \E
ends it). After it does that, hitting Tab moves to $2
, so you can enter that value if you wish. Hitting Tab once more puts the cursor between the {}
curly braces.
Make sure you set the <scope>
to the appropriate language.