Notepad ++同时使用正则表达式和扩展搜索 [英] Notepad++ use both regular expressions and extended search

查看:526
本文介绍了Notepad ++同时使用正则表达式和扩展搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到所有不在字母M之前的\r\n
看来我做不到:

I need to find all \r\n that do not precede the letter M;
Seems I can't do this:

\r\n[^M]

我只能在选择扩展搜索的情况下执行\r\n,或者在选择正则表达式的情况下执行[^M];但不能在一起.

I can only do \r\n with extended search selected or [^M] with regular expressions selected; but not together.

推荐答案

您应改用此正则表达式:

You should instead use this regex:

\R(?!M)

说明:

  • \R任何Unicode换行符序列.
  • (?!M) 负前瞻:断言"M"不能匹配.
  • \R Any Unicode newline sequence.
  • (?!M) Negative Lookahead: Assert "M" cannot be matched.

这篇关于Notepad ++同时使用正则表达式和扩展搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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