AG
Regex
AGREGEX
About
Cheat Sheet
Pattern Library
Guides
Contact
한국어
English
日本語
中文
Español
Português
Français
Deutsch
Русский
العربية
Bahasa Indonesia
← Pattern Library
PATTERN
Username
Regex Pattern
Security · Validation
/
^[a-zA-Z0-9_]{3,16}$
/
Copy
/^[a-zA-Z0-9_]{3,16}$/
Security · Validation
Flags:
—
Description
Validates a 3–16 character username made of letters, digits, and underscores. Spaces and special characters are not allowed. Commonly used as the ID rule on sign-up forms.
Example Matches
cool_user_99
regexFan
Test String
cool_user_99
Open this pattern in the tester
Other Patterns
Strong Password
Credit Card
← Pattern Library