在记事本++中的匹配模式之后添加新行 [英] Add a new line after a matched pattern in Notepad++

查看:69
本文介绍了在记事本++中的匹配模式之后添加新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个csv文件,现在我需要将其另存为另一种格式.

I have a csv-file, now i need to bring it in another form.

我想在特定模式后换行\ r \ n.

I want to have a line break \r\n after a specific pattern.

所有模式如下:

true or false; int number between 0 and 100; decimal number with two or three digits after the point; true or false;

例如:

false;2;23.987;false;
true;0;8.37;false;
false;8;166.987;false;

在最后一个分号之后,我想换行.我正在使用记事本++.

and after the last semicolon, i want to have a line break. I am using notepad++.

感谢您的帮助

推荐答案

您可以使用

\b(?:true|false);\d+;\d+\.\d+;(?:true|false);

或更精确的acc.根据您的规格:

or a more precise acc. to your specs:

\b(?:true|false);(?:\d{1,2}|100);\d+\.\d{2,3};(?:true|false);

并替换为 $ 0 \ r \ n .

详细信息:

  • \ b -单词边界
  • (?: true | false)-与 true false
  • 匹配的非捕获组
  • ; -文字;
  • (?:\ d {1,2} | 100)-1位或2位数字或 100
  • ; -分号
  • \ d + \.\ d {2,3} -1+位数字,原义.,然后是2或3位数字
  • ; -一个;
  • (?: true | false)-还是 true false
  • ; -最后是最后一个分号.
  • \b - word boundary
  • (?:true|false) - a non-capturing group matching either true or false
  • ; - a literal ;
  • (?:\d{1,2}|100) - either any 1 or 2 digits or 100
  • ; - a semi-colon
  • \d+\.\d{2,3} - 1+ digits, a literal . and then 2 or 3 digits
  • ; - a ;
  • (?:true|false) - again either true or false
  • ; - finally, the last semi-colon.

这篇关于在记事本++中的匹配模式之后添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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