I'm using HTML5 form validation to validate phone numbers from India.
Phone numbers from India are 10 digits long, and start with 7, 8, or 9.
For example:
- 7878787878
- 9898989898
- 8678678878
These phone numbers are valid, but
- 1212121212
- 3434545464
- 6545432322
are invalid.
Suggest a pattern that can detect valid India phone numbers.
So far, my pattern is [0-9]{10}
, but it doesn't check if the first digit is 7, 8, or 9.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…