Username Regular Expression

A regular expression that matches all valid usernames (unique identifier).

  • 4-16 characters {4,16}
  • Has a dash
  • Has an underscore
/^[a-zA-Z0-9_-]{4,16}$/

Username Examples:

  • RegexPattern
  • Regex-Pattern
  • Regex_Pattern

See Also: