我有以下列表:
32229_071
32225_041
32225_011
32225_011
32225_011
我希望它看起来像
'32229_071','32225_041','32225_011','32225_011','32225_011'
如何在Notepad ++中做到这一点?
答案 0 :(得分:2)
(?:^|\G)(.+)(?:(\R)|\z)
'$1'(?2,:)
. matches newline
* 说明:
(?:^|\G) # non capture group, beginning of line or restart from last match position
(.+) # group 1, 1 or more any character but newline
(?: # non capture group
(\R) # group 2, any kind of linebreak
| # OR
\z # end of file
) # end group
替换:
'$1' # content of grop 1 between single quotes
(?2,:) # conditional replace, if group 2 exists then a comma else nothing
屏幕截图(之前):
屏幕截图(之后):
答案 1 :(得分:0)