使用regex notepad2在字符串末尾添加字符

Rya*_*nny 9 regex notepad2

我有一个庞大的字符串(一个SQL查询..),我在notepad2中写了.我正在使用Java,我只是想知道是否有一种快速简便的方法来添加到每行的末尾?例如:

String query = "" 
+ " select column1
+ " , column2
+ " , column3
+ " from table
);
//want to add \n" at the end of each line
Run Code Online (Sandbox Code Playgroud)

Jef*_*rey 17

查找:(.)$
替换:\1\\n"

这是一个很好的正则表达式教程.