grok的正则表达式帮助

时间:2015-03-04 07:01:35

标签: regex

我正在尝试为grok编写正则表达式,不幸的是它不适合我

 2015-02-26 12:38:04 -0800 (Thu, 26 Feb 2015) 

我写了这个,但它不起作用

 (?>\d\d){1,2}-(?:0?[1-9]|1[0-2])-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]) (?:2[0123]|[01]?[0-9]):(?:[0-5][0-9]):(?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?) (?:Z|[+-]%{HOUR}(?::?%{MINUTE}))  ((?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?), (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]) \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b (?>\d\d){1,2}) 

非常感谢任何帮助

1 个答案:

答案 0 :(得分:0)

我能够弄清楚

[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\ -[0-9][0-9][0-9][0-9]\ \([A-Z][a-z][a-z]\,\ [0-9][0-9]\ [A-Z][a-z][a-z]\ [0-9][0-9][0-9][0-9]\)"