Build, test, and debug regular expressions
This regex matches Discord invite links, specifically targeting the 'discord.gg' domain followed by an alphanumeric invite code. It optionally matches the 'https://' protocol prefix. It is commonly used in chat moderation bots or anti-spam filters to automatically detect and remove server advertisements. The global and multiline flags ensure it can find multiple links across multiple lines of text.