+ 1
Help with Phone number Validator
#i have this code but i don´t know what is wrong with him import re #your code goes here pattern = r"^1|8|9*[0-9]*{0-8}*" if re.match(pattern, input()): print('Valid') else: print('Invalid')
2 ответов
+ 4
1. In your regular expression you are using {} wrong.
Here you will find how to use it correctly:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Quantifiers
2. You are not restricting the length of a pattern
Here is sequence I used to solve it: r"^[189][0-9]{7}quot;
which means it starts with 1 or 8 or 9 and then continued with exactly 7 digits 0 to 9
+ 1
Þhank you so much my men