Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Rust

r"
(?:https?://)?discord\.(?:gg|com/invite)/\w+
"
gm

Description

A regular expression for Rust that matches against Discord server invite URLs, but not those without an actual code present. This may be used in Discord's AutoMod feature as it supports up to 10 Rust regular expressions per custom rule.

Submitted by sepruko - 3 months ago