From b0da0ac604e2078e99b839792ee18371dc81eb43 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Tue, 4 Oct 2022 17:45:58 -0700 Subject: [PATCH] fix regex capturing groups --- files/helpers/regex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 870908de3..d509813cf 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -90,7 +90,7 @@ ascii_only_regex = re.compile("[ -~]+", flags=re.A) reddit_to_vreddit_regex = re.compile('(^|>|")https:\/\/old.reddit.com\/(r|u)\/', flags=re.A) -reddit_domain_regex = re.compile("(^|\s|\()https?:\/\/(reddit\.com|new\.reddit.com|np\.reddit.com|www\.reddit.com|i\.reddit\.com|libredd\.it|teddit\.net)\/(r|u)\/", flags=re.A) +reddit_domain_regex = re.compile("(^|\s|\()https?:\/\/(reddit\.com|(?:(?:[A-z]{2})(?:-[A-z]{2})" "?|beta|i|m|pay|ssl|www|new|alpha)\.reddit\.com|libredd\.it|teddit\.net)\/(r|u)\/", flags=re.A) color_regex = re.compile("[a-z0-9]{6}", flags=re.A)