简体   繁体   English

用于记事本++的正则表达式以搜索} \\ r}

[英]Regular expressions for Notepad++ to search } \r }

I have something like this in my file: 我的档案中有以下内容:

    material { M_AD26 }
  }
  }
  union {

I would like to replace these two single consecutive brackets with one to yield: 我想用一个替换这两个连续的括号:

    material { M_AD26 }
  }
  union {

In Notepad++ I tried something like (})\\r(\\s)(}) with different number of \\s but never got it right to find these repeated brackets. 在Notepad ++中,我尝试了类似(})\\ r(\\ s)(})之类的东西,但它们的\\ s数量不同,但却找不到正确的括号。 Many thanks for help. 非常感谢您的帮助。

It worked for me: 它为我工作:

在此处输入图片说明

Regex: 正则表达式:

(^\s*\}\s*)\1

Replace: 更换:

\1

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM