【发布时间】:2019-07-03 15:28:15
【问题描述】:
我在排除 VSCode Snippet 中的部分字符串时遇到问题。本质上,我想要的是一条特定的路径,但我无法让正则表达式排除我需要排除的内容。
我最近问了一个类似的问题,您可以在这里找到:Is there a way to trim a TM_FILENAME beyond using TM_FILENAME_BASE?
如您所见,我主要被 sn-ps 在 vscode 中的工作方式所困扰,而不是正则表达式本身
${TM_FILEPATH/(?<=area)(.+)(?=state)/${1:/pascalcase}/}
给定一个看起来像 abc/123/area/my-folder/state/... 的文件路径
预期:
/MyFolder/
实际:
abc/123/areaMyFolderstate/...
【问题讨论】:
标签: regex visual-studio-code vscode-snippets