I am looking to create a system which on signup will create a subdomain on my website for the users account area.
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update
I have this regex that test for an input with max length of 5. My problem is I want to exclude the single digit of 2. If string contains only number "2", it should fail. How do I exclude number 2 in this regex? /^([a-zA-Z,\d]){1,5}$/
13425 - Match
03277 - Match
2 - Fail.
A negative look-ahead assertion can do this for you
ReplyDelete/^(?!2$)([a-zA-Z,\d]){1,5}$/