Skip to main content

Variable: DiscordInviteLinkRegex

const DiscordInviteLinkRegex: RegExp

Regex that can can capture the code of Discord invite links

Raw

/(?:^|\b)discord(?:(?:app)?\.com/invite|\.gg(?:/invite)?)/(?<code>[\w-]{2,255})(?:$|\b)/gi

Remark

Capture group 1 is the invite URL's unique code. It is named code.

Defined in

projects/utilities/packages/discord-utilities/src/lib/regexes.ts:33