【发布时间】:2013-04-02 23:09:18
【问题描述】:
所以这里我有来自 BNC 格式的 IRC 日志(其中 [AA:BB:CC] 不是实际时间,只是加载时间):
[AA:BB:CC] <Person1> [re:al:ts] BLAH BLAH BLAH
[AA:BB:CC] <Person2> [an:ot:he] BLAH BLAH BLAH
[AA:BB:CC] <Person3> [rr:ea:lt] BLAH BLAH BLAH
[AA:BB:CC] <Person4> [im:es:tp] BLAH BLAH BLAH
我想把它转换成:
[re:al:ts] <Person1> BLAH BLAH BLAH
[an:ot:he] <Person2> BLAH BLAH BLAH
[rr:ea:lt] <Person3> BLAH BLAH BLAH
[im:es:tp] <Person4> BLAH BLAH BLAH
这在技术上可行吗?我看到 [AA:BB:CC] 可以很容易地被删除,但是我如何保留真正的时间戳并将它们移动到行的 /beginning/ 而不删除“blah blah blah”或“”s?老实说,我不是很精通正则表达式...
谢谢 :) 枫树
【问题讨论】:
-
我认为时间戳是
hh:mm:ss的形式是否正确?你能提供一个真实的例子吗?除非你想让我猜你文件的内容是什么。
标签: regex irc reformat reformatting