user1875195
user1875195

Reputation: 988

Regex expression to match alpha character as first character and the rest alphanumeric

Im trying to write a regex to match the following:

must start with a letter
the rest must be alphanumeric 
at least one character in length
max characters 12

Should me able to match

a
k2jdj
hello
example72812

Upvotes: 1

Views: 1736

Answers (2)

alestanis
alestanis

Reputation: 21863

You can try

[a-zA-Z][a-zA-Z0-9]{0,11}

Upvotes: 2

Kent
Kent

Reputation: 195039

this?

 [a-zA-Z][a-zA-Z0-9]{0,11}

Upvotes: 1

Related Questions