我有一条日志行,其中日志级别仅由一个字母定义W-警告,E-错误...我如何才能从整个日志行中提取出确切的字母(CacheMessenge后的字母E) ?
[11/26/18 15:36:43:781 CET] 00003734 CacheMessenge E CWLLG2057E: A JMSException occurred with a linked Exception. Linked Error: CWSIT0008E: A successful connection was made to the bootstrap server at
答案 0 :(得分:0)
您可以尝试
(?<=CacheMessenge\s)[A-Z]
说明
(?<=CacheMessenge\s)
-积极回望。在比赛之前测试CacheMessenge
。[A-Z]
-匹配任何一个大写字母。