删除SPECIFIC行末尾的符号

时间:2013-11-02 13:40:59

标签: regex notepad++

我是一个相当缺乏经验的Notepad ++用户,而且我几乎只做复制粘贴这里发布的不同正则表达式查询 - 以清理游戏服务器日志等内容。现在我发现了一个无法通过Stackoverflow研究解决的问题。

我想删除每行末尾的最后一个字母(符号),但只有它是“!”长话短说,我想要一个正则表达式查询,让我摆脱这样的东西:

Jedi=Knight=Virdu: Hello everyone.!
Jedi=Master=Yvan: <bows his head, barely keeping his eyes open, like he is about to fall asleep>!
Padawan=Acodin has joined the spectators.
Padawan=Vic has defeated: Training Droid [NPC].
Jedi=Knight=Rus: Is something wrong, Master Yvan?!

并将其转换为:

Jedi=Knight=Virdu: Hello everyone.
Jedi=Master=Yvan: <bows his head, barely keeping his eyes open, like he is about to fall asleep>
Padawan=Acodin has joined the spectators.
Padawan=Vic has defeated: Training Droid [NPC].
Jedi=Knight=Rus: Is something wrong, Master Yvan?

非常感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

您可以搜索“!$”(匹配所有以“!”结尾的行),并将其替换为空。所以你只需将日志粘贴到记事本,像往常一样输入ctrl ^ f,转到替换窗口,在第一个框中输入!$并留下第二个空白。