Get file name without extension, text editor

Thought it might work:

${TM_FILENAME/(.+?)(\.[^.]*$|$)/}

But this gives me this error:

Error Parsing Snippet

line 1:257: expecting regexp options, found ''

Any tips?

+3
source share
2 answers

My initial goal was to get rid of the .js extension, and it works like a charm.

${TM_FILENAME/[\.js]+$//}
+3
source

Here's the solution to crop the shared file extension

${TM_FILENAME/(.*)[.](.*)/$1/g}
+4
source

Source: https://habr.com/ru/post/1720597/


All Articles