Test, validate and match regular expressions
Matches strings of 1 to 16 characters containing only letters, digits, and underscores — the exact format rules for Minecraft usernames, including short legacy accounts. Anchored with ^ and $ plus the multiline flag, it validates each line independently, making it ideal for bulk-checking usernames from lists or text files. Commonly used in registration forms, Discord bots, and server plugins to validate player names. Note it permits 1-2 character legacy names and doesn't enforce Mojang's 3-character minimum for new accounts.