Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract a portion of TM_FILENAME_BASE

I'm trying to write a snippet to quickly/easily generate an interface for a repository. If I name the file IFooRepository I'd like the snippet to place the word Foo in a few areas.

I'm assuming this can be achieved by transforming the TM_FILENAME_BASE variable provided out of the box, but am having a hard time figuring it out.

like image 907
James Chadwick Avatar asked Dec 03 '25 00:12

James Chadwick


1 Answers

Figured it out. Man I suck at regular expressions and was thinking about this all wrong

${TM_FILENAME_BASE/I(.*)Repository/$1/}

like image 80
James Chadwick Avatar answered Dec 04 '25 15:12

James Chadwick