Regular Expressions 101

Community Patterns

Discord Token Regex

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(mfa\.[a-z0-9_-]{20,})|([a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})$
/
gm

Description

Regex that will verify if a valid token has been provided. This comes directly from Discord's source.

Submitted by Discord - 7 months ago