如何使用Notepad ++正则表达式管道超过一个字符的字符串? [英] How do you use Notepad++ regex pipe | for strings longer than one character?

查看:161
本文介绍了如何使用Notepad ++正则表达式管道超过一个字符的字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使notepad ++正则表达式在以下句子中找到"abc"和"def"的所有实例:

I'm trying to get notepad++ to regex find all instances of "abc" and "def" in the following sentence:

美国广播公司去了mod.

The abc went to the def.

以下语法似乎都不起作用:

None of the following syntaxes seem to work:

  • abc | def
  • [abc | def]
  • (abc)|(def)
  • (abc | def)

注意:"[a | d]"与我测试过的"a"或"d"的任何实例匹配

NOTE: "[a|d]" matches any instance of "a" or "d" when I tested

推荐答案

升级到Notepad ++ v6.从变更日志中:支持PCRE(与Perl兼容的正则表达式)."我已经证实|使用Notepad ++ v6时,可以在正则表达式搜索中使用.

Upgrade to Notepad++ v6. From the changelog: "PCRE (Perl Compatible Regular Expressions) is supported." I've verified that | works in regex search when using Notepad++ v6.

这篇关于如何使用Notepad ++正则表达式管道超过一个字符的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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