aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_core/utils
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_core/utils')
-rw-r--r--pydis_core/utils/regex.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/pydis_core/utils/regex.py b/pydis_core/utils/regex.py
index 13a6d220..1ccc0813 100644
--- a/pydis_core/utils/regex.py
+++ b/pydis_core/utils/regex.py
@@ -4,15 +4,17 @@ import re
DISCORD_INVITE = re.compile(
r"(https?://)?(www\.)?" # Optional http(s) and www.
- r"(discord([.,]|dot)gg|" # Could be discord.gg
- r"discord([.,]|dot)com|" # or discord.com/invite
- r"discordapp([.,]|dot)com|" # or discordapp.com/invite
- r"discord([.,]|dot)me|" # or discord.me
- r"discord([.,]|dot)li|" # or discord.li
- r"discord([.,]|dot)io|" # or discord.io
- r"((?<!\w)([.,]|dot))gg" # or .gg
+ r"("
+ r"discord([.,]|dot)gg|" # Could be discord.gg
+ r"discord([.,]|dot)com|" # or discord.com/invite
+ r"discordapp([.,]|dot)com|" # or discordapp.com/invite
+ r"discord([.,]|dot)me|" # or discord.me
+ r"discord([.,]|dot)li|" # or discord.li
+ r"discord([.,]|dot)io|" # or discord.io
+ r"((?<!\w)([.,]|dot))gg" # or .gg
+ r")"
r"((/|slash|\\)(invite))?" # / or \ or 'slash' invite
- r")(/|slash|\\)" # / or \ or 'slash'
+ r"(/|slash|\\)" # / or \ or 'slash'
r"(?P<invite>\S+)", # the invite code itself
flags=re.IGNORECASE
)