【发布时间】:2012-09-24 03:16:07
【问题描述】:
我尝试了以下链接中可能包含空格或连字符的 7-12 位电话号码的解决方案。第一个和最后一个字符必须是数字。
Regular expression to match 7-12 digits; may contain space or hyphen
但是,我不太了解正则表达式。
$phone_pattern="/^\d(?:[-\s]?\d){6,11}$/";
这里的“:”是什么意思?
这个正则表达式如何能够排除 6 到 11 个字符中的连字符和空格?
非常感谢您的帮助
【问题讨论】:
-
您究竟需要什么帮助?你有一个解决方案,你需要解释一下吗?或者你想匹配不同的东西。
标签: php regex phone-number