如何提取 TM_FILENAME_BASE 的一部分 [英] How to extract a portion of TM_FILENAME_BASE

查看:32
本文介绍了如何提取 TM_FILENAME_BASE 的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个片段来快速/轻松地为存储库生成一个界面.如果我将文件命名为 IFooRepository,我希望代码片段将 Foo 一词放在几个区域.

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.

我假设这可以通过转换开箱即用的 TM_FILENAME_BASE 变量来实现,但我很难弄清楚.

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.

推荐答案

想通了.伙计,我很讨厌正则表达式,并且认为这一切都错了

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

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

这篇关于如何提取 TM_FILENAME_BASE 的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆