We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DISCORD_INVITE
1 parent c5d3c5a commit c9daa6fCopy full SHA for c9daa6f
botcore/utils/regex.py
@@ -11,13 +11,17 @@
11
r"discord([.,]|dot)io|" # or discord.io.
12
r"((?<!\w)([.,]|dot))gg" # or .gg/
13
r")([/]|slash)" # / or 'slash'
14
- r"(?P<invite>[a-zA-Z0-9\-]+)", # the invite code itself
+ r"(?P<invite>\S+)", # the invite code itself
15
flags=re.IGNORECASE
16
)
17
"""
18
Regex for Discord server invites.
19
20
:meta hide-value:
21
+.. warning::
22
+ This regex pattern will capture until a whitespace, if you are to use the 'invite' capture group in
23
+ any HTTP requests or similar. Please ensure you sanitise the output using something similar to
24
+ https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote.
25
26
27
FORMATTED_CODE_REGEX = re.compile(
0 commit comments