Regular Expressions 101

Community Patterns

1...56789...593

Discord Invite link - Updated

0

Regular Expression
PCRE2 (PHP >=7.3)

/
discord(?:app)?\.com\/(?:(friend-)?invite|servers)?\/([a-z0-9\-]+)|discord\.gg\/(?:\S+\/)?([a-z0-9\-]+)
/
gm

Description

Can match 7 variations of invites (the page discord.com/servers/ is included)

Submitted by Diso - a year ago