Password Validation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Password Validation

https://code.sololearn.com/c3wRNnv6J7dN/?ref=app https://code.sololearn.com/ciRxA8ecr07W/?ref=app I'm trying to solve this problem by using Regex However the code that I have written couldn't pass the test case #8 Does anyone has any idea what's wrong with my code

9th May 2020, 10:54 AM
Chase Chai
Chase Chai - avatar
2 Answers
+ 1
I think "[0-9{2,}]" is not proper regex. You probably want something like "[0-9].*[0-9]" which means a digit, followed by some random stuff or nothing, followed by another digit. Same thing in the regex below. There is a great testing tool for regex at https://regex101.com, check it out!
9th May 2020, 11:30 AM
Schindlabua
Schindlabua - avatar
+ 1
Thanks a lot I have solved the problem 👍
9th May 2020, 11:46 AM
Chase Chai
Chase Chai - avatar