-1

我是一个相当缺乏经验的 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?

提前感谢您的帮助!

4

1 回答 1

0

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

于 2013-11-02T13:48:37.220 回答