0
Why test case 3 failed?
import re pattern = r"^(1|8|9)[0-9]{7}" phone = input() if re.match(pattern,phone): print("Valid") else: print("Invalid")
3 Respuestas
+ 2
try with pattern = r'^(1|8|9)[0-9]{7}#x27; to match full string only ;)
... or shorter: r'^[189]\d{7}#x27;
0
$ at the end worked... Thank you so much.
- 2
Don't Know 😏
I'm a beginner but will become Experienced and Professional soon, because I Have Self-confidence !👍🏻
Then, I'll answer this,.. if I will remember..😀