aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Bradley Reynolds <[email protected]>2022-02-23 13:46:34 -0600
committerGravatar Bradley Reynolds <[email protected]>2022-02-23 13:46:34 -0600
commit57ea1dc0d077fe02801b32691989aadbefe6a908 (patch)
tree7d5efa4b4792a7882970f0aa383ad781558915af
parentUse random.choice to select an item from a list (diff)
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.
-rw-r--r--bot/exts/fun/uwu.py4
1 files changed, 2 insertions, 2 deletions
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):