Javascript Regex - What to use to validate a phone number?

后端 未结 6 681
你的背包
你的背包 2020-12-05 21:04

Could anyone tell me what RegEx would work to validate an international phone number including white space between the numbers and also allowing for these chars: - ( )

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 21:27

    Don't even try. Trying to guard against what you think is invalid input can result in angry users who can't enter perfectly valid phone numbers. And if the user really wants to enter an invalid phone number, he/she will be able to do it anyway.

提交回复
热议问题