Javascript phone number validation

后端 未结 7 815
感动是毒
感动是毒 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条回答
  •  Happy的楠姐
    2020-12-01 19:09

    Google's libphonenumber is very helpful for validation and formatting of phone numbers all over the world. It is easier, less cryptic, and more robust than using a RegEx, and it comes in JavaScript, Ruby, Python, C#, PHP, and Objective-C flavors.

提交回复
热议问题