Skip to content

Commit

Permalink
Move discord(app) capture to its own optional group in invite regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Oct 17, 2024
1 parent 9385e91 commit 4df8e90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pydis_core/utils/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

DISCORD_INVITE = re.compile(
r"(https?://)?(www\.)?" # Optional http(s) and www.
r"(discord(app)?)?" # Optional discord(app)
r"("
r"discord(app)?([.,]|dot)gg|" # Could be discord(app).gg
r"discord(app)?([.,]|dot)com|" # or discord(app).com/invite
r"discord(app)?([.,]|dot)me|" # or discord(app).me
r"discord(app)?([.,]|dot)li|" # or discord(app).li
r"discord(app)?([.,]|dot)io|" # or discord(app).io
r"((?<!\w)([.,]|dot))gg" # or .gg
r"([.,]|dot)gg|" # Could be .gg
r"([.,]|dot)com|" # or .com
r"([.,]|dot)me|" # or .me
r"([.,]|dot)li|" # or .li
r"([.,]|dot)io" # or .io
r")"
r"((/|slash|\\)(invite))?" # / or \ or 'slash' invite
r"(/|slash|\\)" # / or \ or 'slash'
Expand Down

0 comments on commit 4df8e90

Please sign in to comment.