【发布时间】:2016-01-05 16:26:03
【问题描述】:
所以我一直在尝试使用正则表达式来解析以下字符串:
INFO: Device 6: Time 20.11.2015 06:28:00 - [Script] FunFehlerButton: Execute [0031 text]
and
INFO: Device 0: Time 09.12.2015 03:51:44 - [Replication] FunFehlerButton: Execute
and
INFO: Device 6: Time 20.11.2015 06:28:00 - FunFehlerButton: Execute
我尝试使用的正则表达式是:
(?<=\\d{1,2}:\\d{2}:\\d{2} - ).*
和
(?<=\\[\\w*\\]).*
其中第一个运行正确,第二个运行异常。
我的目标是获取文本“FunFehlerButton: Execute ...”。
我希望有人能提示我正确的方向。
【问题讨论】:
-
嘿,有一个页面txt2re,您可以在其中从字符串创建正则表达式。
-
@JorgeCampos,他也想在结尾加点。