Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以这些范围开头的任何电话号码都是正确的:例如:772123322
长度很重要,最后应该包含 6 位数字
550-559 700-709 770-779
所以,到目前为止我已经这样做了:
\A(55[0-9])|(70[0-9])|(77[0-9])\d{6}\z
如何修改这个正则表达式才能正常工作?
更简单的是:
/^(55|70|77)\d{7}$/
\A(55[0-9]|70[0-9]|77[0-9])\d{6}\z