1

I am trying to make a ST2 snippet to insert a comment "section" in my PHP code. I am attempting to achieve something like the following:

// --------------------------------------------------
//   ${1:Enter section title here/^(.*)$/\U\1/}
// --------------------------------------------------

So that when the snippet is triggered, a user might enter "dumb loop" as $1, and it would be transformed to "DUMB LOOP".

The problem is, I am getting errors when I try to do this. Am I correct in assuming ST2 doesn't support this? The best I am able to do to achieve this right now is:

// --------------------------------------------------
//   ${1/^(.*)$/\U\1/}
// --------------------------------------------------
// DELETE THIS LINE: $1

Which more or less enters junk text into the snippet because that last line is only needed to "create" parameter 1, so that it can be correctly transformed and placed where it should go.

Is there any way to transform a snippet parameter in the same place it is defined/located?! Thanks!!

niebaum
  • 11
  • 1
  • Did you read the fine [documentation](http://docs.sublimetext.info/en/latest/extensibility/snippets.html#substitutions)? – MattDMo Jul 17 '16 at 21:07

0 Answers0