替换在Sublime Text& Visual Studio代码
我想在这两个IDE,崇高的文本和Visual Studio代码中更换命名的捕获组。而且,我实际上成功地使用了Intellij Webstorm。
一个示例语料库是:
Title: Hamlet
Genre: Tragedy
Playwright: Williams Shakespere
Title: Woyzeck
Genre: Tragedy
Playwright: Karl Georg Büchner
我使用以下等级来检索剧作家
Playwright: (?<playwright>.*)
,然后用以下等级替换为XML格式包装,以进行进一步的分析,
<playwright>${playwright}</playwright>
同时崇高文本和Visual Studio代码在此结果中失败了:
Title: Hamlet
Genre: Tragedy
<playwright>${playwright}</playwright>
Title: Woyzeck
Genre: Tragedy
<playwright>${playwright}</playwright>
当WebStorm提供正确的结果时
有人知道如何使用这两个IDE做到这一点吗?
I would like to do the replacement of the named capture group in these two IDE, Sublime Text and Visual Studio Code. And, I actually succeed in using IntelliJ WebStorm.
An example corpus was:
Title: Hamlet
Genre: Tragedy
Playwright: Williams Shakespere
Title: Woyzeck
Genre: Tragedy
Playwright: Karl Georg Büchner
and I used the following RegEx to retrieve the playwright
Playwright: (?<playwright>.*)
and replace this with the following RegEx to wrap in an XML format for the further analysis
<playwright>${playwright}</playwright>
Both Sublime Text and Visual Studio Code failed with this outcome:
Title: Hamlet
Genre: Tragedy
<playwright>${playwright}</playwright>
Title: Woyzeck
Genre: Tragedy
<playwright>${playwright}</playwright>
While WebStorm delivered the right results
Does anyone know how to make it with these two IDEs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
在sublimetext中,替换模式 名为backRefreferences ,并且应该像
Visual Studio代码一样,命名为Backreferences是不支持 在替换模式中(功能请求没有收集足够的社区upvotes)。
In SublimeText, the replacement pattern can contain named backreferences and should look like
In Visual Studio Code, named backreferences are not supported in the replacement patterns (the feature request did not collect enough community upvotes).