From 57ea1dc0d077fe02801b32691989aadbefe6a908 Mon Sep 17 00:00:00 2001 From: Bradley Reynolds Date: Wed, 23 Feb 2022 13:46:34 -0600 Subject: Fix invalid regex Use just one group instead of two distinct ones Don't compile the substitution regex because the backreference doesn't exist yet. Use correct syntax for backreferences. --- bot/exts/fun/uwu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py index 13fb11e5..67d8c9c7 100644 --- a/bot/exts/fun/uwu.py +++ b/bot/exts/fun/uwu.py @@ -50,8 +50,8 @@ REGEX_PUNCTUATION = re.compile(r"[.!?\r\n\t]") REGEX_STUTTER = re.compile(r"(\s)([a-zA-Z])") SUBSTITUTE_STUTTER = r"\g<1>\g<2>-\g<2>" -REGEX_NYA = re.compile(r"n([aeou])([^aeiou])") -SUBSTITUTE_NYA = re.compile(r"ny\g<1>\g<2>") +REGEX_NYA = re.compile(r"n([aeou][^aeiou])") +SUBSTITUTE_NYA = r"ny\1" class Uwu(Cog): -- cgit v1.2.3