Given a string like #fff443 or #999999
How do I verify that the string has:
- 7 characters, with the first one being a hash
- no symbols in the string besides the hash in the beginning
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It seems that you are matching against a css color:
To elaborate:
^match beginning#a hash[a-f0-9]any letter from a-f and 0-9{6}the previous group appears exactly 6 times$match endiignore case