Javascript phone number validation

后端 未结 7 805
感动是毒
感动是毒 2020-12-01 18:51

I need to validate a phone number in javascript. The requirements are:

they should be 10 digits, no comma, no dashes, just the numbers, and not the

相关标签:
7条回答
  • 2020-12-01 19:20
    function validate(phoneString){
    
        reg = /^([+|\d])+([\s|\d])+([\d])$/;
    
        return reg.test(phoneString);
    
    }
    
    0 讨论(0)
提交回复
热议问题