Regex us number format with specific format for +1-xxx-xxx-xxxx?

后端 未结 0 1714
面向向阳花
面向向阳花 2020-11-22 09:55

this is my code but doesn\'t work and i dunno why?:

const phoneRegex = RegExp(
  /^\\(\\+1\\)?[-]?([0-9]{3})\\)?[-]?([0-9]{3})[-]?([0-9]{4})$/
);
相关标签:
回答
  • 消灭零回复
提交回复
热议问题