diff options
author | Georg Brandl <georg@python.org> | 2014-10-07 15:18:55 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-07 15:18:55 +0200 |
commit | db288cd60ae8d92f6aa95a7061a43f24d2637b48 (patch) | |
tree | b0bec2d1fb3f9293c315650dc727460a49c25982 /pygments | |
parent | bee0e0cbaa12bba306d8f5c52c6e749f1eb6ea26 (diff) | |
download | pygments-db288cd60ae8d92f6aa95a7061a43f24d2637b48.tar.gz |
Closes #982: fix pathological matching behavior for timestamps in IRC logs lexer
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/textfmts.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pygments/lexers/textfmts.py b/pygments/lexers/textfmts.py index 63e67182..e3700e9f 100644 --- a/pygments/lexers/textfmts.py +++ b/pygments/lexers/textfmts.py @@ -35,9 +35,11 @@ class IrcLogsLexer(RegexLexer): # irssi / xchat and others (?: \[|\()? # Opening bracket or paren for the timestamp (?: # Timestamp - (?: (?:\d{1,4} [-/]?)+ # Date as - or /-separated groups of digits + (?: (?:\d{1,4} [-/])* # Date as - or /-separated groups of digits + (?:\d{1,4}) [T ])? # Date/time separator: T or space - (?: \d?\d [:.]?)+ # Time as :/.-separated groups of 1 or 2 digits + (?: \d?\d [:.])* # Time as :/.-separated groups of 1 or 2 digits + (?: \d?\d [:.]) ) (?: \]|\))?\s+ # Closing bracket or paren for the timestamp | |