Notepad++:在匹配某些字符串后插入空白新行 [英] Notepad++ : Insert blank new line after match of some string

查看:77
本文介绍了Notepad++:在匹配某些字符串后插入空白新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在notepad++中整个文档的(4)选项后插入新行

<块引用>

  1. 因为他涉嫌参与
    间谍
    (1) abc
    (2) sdf
    (3) asf
    (4) 聚合
  2. 当校长进来时
    上课了,我所有的朋友都安静...
    (1) dfg
    (2) hsc
    (3) sdg
    (4) fse

下面的表达式不起作用.
查找内容:^.+(4)
替换为:\n$0

解决方案

应该是这样的.

查找:(\(4\).+)

替换:$1\n

请记住,括号 () 在正则表达式中具有特殊含义,因此您应该使用 \ 将它们转义.>

I want to insert new line after (4) option in whole document in notepad++

  1. For his alleged involvement in
    espio-nage
    (1) abc
    (2) sdf
    (3) asf
    (4) agg
  2. When the Principal was entering
    the class, all my friends quietly...
    (1) dfg
    (2) hsc
    (3) sdg
    (4) fse

Below expression is not working.
Find what: ^.+(4)
Replace with: \n$0

解决方案

Should be like this.

Find: (\(4\).+)

Replace: $1\n

Keep in mind that the brackets ( and ) have a special meaning in regex, so you should escape them with \.

这篇关于Notepad++:在匹配某些字符串后插入空白新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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