【问题标题】:Replace one-line text with newline-separated texts [closed]用换行符分隔的文本替换单行文本[关闭]
【发布时间】:2011-11-21 16:29:43
【问题描述】:

我有这串 5000 人

532433.pptx John 22 AZ 432343.pptx marry 32 CZ 294838.pptx Sam 14 LA.....

以xxxxxx.pptx分隔

我想转换成这个:

 532433.pptx John 22 AZ 
 432343.pptx marry 32 CZ
 294838.pptx Sam 14 LA
 .....

像 Excel 的复制和更改行和列粘贴。

我设法通过 Notepad++ Regex (^[0-9]+.pptx) 找到了该模式编号(xxxxxx.pptx)

但是如何将找到的查询(532433.pptx)导入替换字段?

【问题讨论】:

  • 什么是“查找和加号”?还有什么?
  • 您想将 (^[0-9]+.pptx) 替换为 CR/LF + (^[0-9]+.pptx)?
  • 拜托,下次再努力一点,让您的问题不容置疑,并在发布前纠正错别字。

标签: string text replace find notepad++


【解决方案1】:

查找内容:([0-9]+.pptx)

替换为:\r\n\1

正则表达式模式


输入:

532433.pptx John 22 AZ 432343.pptx marry 32 CZ 294838.pptx Sam 14 LA

输出:

532433.pptx John 22 AZ 
432343.pptx marry 32 CZ 
294838.pptx Sam 14 LA

\r\n 是换行符,\1 是对应于第一个括号的匹配项(\2 将对应于第二个等。如果正则表达式中有多个括号)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-30
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 2013-02-19
    相关资源
    最近更新 更多