Regex To Check If The First Letter Is Uppercase

A regular expression to match and validate if the first letter of a string is uppercase.

/^[A-Z][a-z0-9_-]{3,19}$/

Matches:

  • Regex
  • Pattern
  • Com

Non-Matches:

  • regex
  • pattern
  • com

See Also: