Problem with phone number validator task in regular expressions module In python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem with phone number validator task in regular expressions module In python

I got a problem with the phone number validator assignment in the regular expressions module in python. My code works with all test cases except number 3 and I am not sure why. I would appreciate some ideas. https://code.sololearn.com/c0CLk42nh4Vj/?ref=app

4th Dec 2020, 1:06 AM
Víctor Ávila
Víctor Ávila - avatar
2 Answers
+ 1
it may need '^' and '
#x27; to specify the beggining and end
4th Dec 2020, 1:48 AM
Slick
Slick - avatar
+ 1
Although, I don't get the logic behind it, specifying the end worked. Thanks
4th Dec 2020, 1:56 AM
Víctor Ávila
Víctor Ávila - avatar