I am looking for a PHP regex to check a string is:
A good example is: A123
A123
Thanks!
^[A-Z][0-9]{3}$
Explanation:
^ # start of string [A-Z] # one character, A-Z [0-9]{3} # three characters, 0-9 $ # end of string
\d
[0-9]
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
By posting your answer, you agree to the privacy policy and terms of service.
asked
4 years ago
viewed
83 times
active