Skip to content

Commit a6ff35d

Browse files
committed
fixed datetime regex
1 parent 4f2e4f0 commit a6ff35d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xmnlp/config/regx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
special_tags = [
1919
("datetime", re.compile(r"(?:\d{4}[年\-\./]\s*\d{1,2}[月\-\./]\d{1,2}\s{0,1}\d{1,2}:\d{1,2}(?:\:\d{1,2})?)|"
20-
r"(?:\d{2,4}\s*年\s*(?:\d{1,2}\s*月\s*)?(?:\d{0,2}\s*[日号]\s*)?)")),
20+
r"(?:\d{2,4}\s*年\s*(?:\d{1,2}\s*月\s*)?(?:\d{0,2}\s*[日号]\s*)?)|"
21+
r"(?:\d{1,2}\s*月\s*\d{0,2}\s*[日号]\s*)|"
22+
r"(?:\d{1,2}\s*月)")),
2123
("email", re.compile(r"[a-zA-Z0-9\-_\.]+@[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_\.]+", re.IGNORECASE)),
2224
("url", re.compile(r"(?:http|ftp)s?://" # http:// or https://
2325
r"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|" # domain

0 commit comments

Comments
 (0)