From d5987ad70e71325d41a6a17450936543cdef987b Mon Sep 17 00:00:00 2001 From: Chuck Sneed Date: Mon, 26 Jun 2023 08:55:13 -0500 Subject: [PATCH] The fucking best regex ever --- files/helpers/regex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index a60e3fa45..dfc911e6d 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -98,8 +98,8 @@ xmaxed_regex = re.compile('(?<=^|(?<=\s))(([a-zA-Z]+?)(s)?max*ed)(?=$|\n|\s|[.?! xmaxing_regex = re.compile('(?<=^|(?<=\s))(([a-zA-Z]+?)(s)?max*ing)(?=$|\n|\s|[.?!,])', flags=re.I|re.A) initial_part_regex = re.compile('(?<=^)(>+)', flags=re.I|re.A) -#matches "the" or is, but only if it is not followed by "fucking" -the_fucking_regex = re.compile('(?<=^|(?<=\s))(the|(is (?:your|her|his|their|no|a|not|to|so|this|the|our|what)( (a|the))?)|is)(?=$|\n|\s)(?! fucking)', flags=re.I|re.A) +#matches "the" or is, but only if it is not followed by "fucking". https://regex101.com/r/yxuYsQ/2 +the_fucking_regex = re.compile('(?<=^|(?<=\s))((?:the|a)( (?:only))?|((that )?(?:is|are|was|were|will be|would be)( (?:your|her|his|their|no|a|not|to|too|so|this|the|our|what))?( (a|the))?)|is)(?=\s)(?! fucking)', flags=re.I|re.A) #matches a single question mark but only if it isn't preceded by ", bitch" bitch_question_mark_regex = re.compile('(?