How to extract a portion of TM_FILENAME_BASE

孤街浪徒 提交于 2021-02-10 14:19:55

问题


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.


回答1:


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

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



来源:https://stackoverflow.com/questions/58459540/how-to-extract-a-portion-of-tm-filename-base

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!