Skip to content

Commit c9daa6f

Browse files
committed
DISCORD_INVITE captures until a whitespace
1 parent c5d3c5a commit c9daa6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

botcore/utils/regex.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
r"discord([.,]|dot)io|" # or discord.io.
1212
r"((?<!\w)([.,]|dot))gg" # or .gg/
1313
r")([/]|slash)" # / or 'slash'
14-
r"(?P<invite>[a-zA-Z0-9\-]+)", # the invite code itself
14+
r"(?P<invite>\S+)", # the invite code itself
1515
flags=re.IGNORECASE
1616
)
1717
"""
1818
Regex for Discord server invites.
1919
2020
: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.
2125
"""
2226

2327
FORMATTED_CODE_REGEX = re.compile(

0 commit comments

Comments
 (0)