Search code examples
textmatetextmatebundles

TextMate Snippet: How to uppercase the first letter in a regexp


How can I make the first letter upper case in the following:

${1:${TM_FILENAME/[\.php]+$//}}

Basically if the filename is "welcome.php", I'd like it to write out "Welcome". This at the moment writes "welcome" (lower case w).


Solution

  • Try the following snippet. Works for me.

    ${TM_FILENAME/(.*?)(\..+)/\u$1/}