regex matching alpha character followed by 4 alphanumerics

EDIT: Grrr… edited regex due to new “clarification” 🙂

^[A-C][a-zA-Z0-9]{4}$

EDIT: To explain the above Regex in English…

^ and $ mean “From start to finish” (this ensures that the whole string must perfectly match)

[A-C] means “Match either A, B, or C

[a-zA-Z0-9]{4} means “Match 4 lower case letters, upper case letters, or numbers”

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)