(win/linux) 具有良好正则表达式支持的文本编辑器
我正在 win7/ubuntu 中寻找一个具有良好正则表达式支持的文本编辑器。我已经尝试了一些具有部分支持或似乎使用自定义语法的程序,因此我正在寻找一个具有完全支持和没有/很少自定义样式正则表达式的程序。例如,我尝试对某些文本执行以下 exp:
^((?!test).)*$
来查找没有单词 test in 的行。我已经在各种在线工具中对此进行了测试,我认为 reg exp 很健全,但我找不到可以使用/信任的文本编辑器。
I'm looking for a text editor in win7/ubuntu which has good regex support. I've tried a few which have partial support or seem to use a custom syntax, so I'm looking for a program which has full support and no/little custom style regex. For example, I'm trying to execute the following exp against some text:
^((?!test).)*$
to find lines without the word test in. I've tested this in various online tools and I think the reg exp is sound, but i can't find a text editor which I can use/trust.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Vim 有正则表达式支持,但模式语法有点不同:
您可以通过打开verymagic 设置来使其不那么晦涩:
阅读
:help pattern
。另请注意,此模式匹配
est
以及一行中最后一次出现test
后的字符,或不包含test
的整行。这就是你想要的吗?如果您不了解 vim,您可能应该从
vimtutor
开始。Vim 的设计初衷并不是为了用户友好性,并且学习曲线陡峭。Vim has regex support but the pattern syntax is a bit different:
You can make it less obscure by turning on the verymagic setting:
read
:help pattern
.Also note that this pattern matches
est
and following characters just after the last occurrence oftest
on a line, or whole lines containing no occurrence oftest
. Is that what you want?If you don't know vim, you should probably start with
vimtutor
. Vim is not designed for user friendliness, and has a steep learning curve.Vim 支持这种类型的否定前瞻,尽管语法不同。
请参阅此处:
Vim has support for that type of negative lookahead, even though the syntax is different.
See here: