Here is a regular expression I created to use in JavaScript:
var reg_num = /^(7|8|9)d{9}$/
Here is another one suggested by my team member.
var reg_num = /^[7|8|9][d]{9}$/
The rule is to validate a phone number:
- It should be of only ten numbers.
- The first number is supposed to be any of 7, 8 or 9.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…