1

I need to create a TextMate snippet that will mirror an input and make it camel cased.

The base snippet looks like this:

<a href="#${1}" data-toggle="tab">${1:Tab 1}</a>

Example input: Some text here
Example output: someTextHere

I tried doing the following as the mirror replacement, but the regex only captures the first match:

${1/\A(\w+)\s?/(?1:\U$1)/ig}
jdubwelch
  • 21
  • 4

1 Answers1

0

Have you looked at the "Source" bundle in Textmate? It has a "Toggle camelCase / snake_case / PascalCase" command; you could take inspiration from the regex in there.

Matthias
  • 150
  • 1
  • 8