荷兰电话号码的正则表达式 [英] Regular expression for Dutch phone number

查看:190
本文介绍了荷兰电话号码的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个与荷兰电话号码匹配的正则表达式.这些是格式要求:

I'm looking for a regular expression to match a Dutch phone number. These are the formatting requirements:

  • 应以0开头
  • 最多包含1个(可选)破折号-"字符,现在,只要不是第一个字符,就不管它在哪里
  • 总长度为10或11个字符

这是我到目前为止提出的:

This is what I've come up with so far:

^0+-{1}?([0-9]{10,11})$

推荐答案

我之前在 http://regexlib.com/Search.aspx?k=phone%20number 检查此网站,希望对您有所帮助.

I have seen this before at http://regexlib.com/Search.aspx?k=phone%20number Check this website out, hope it helps.

(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)

用于评估荷兰式电话号码的正则表达式.可能的 前缀示例:+ 31,+ 31(0),(+ 31)(0),0、0031后跟9个数字 (可以包含空格或-).

Regular expression to evaluate dutch-style phone numbers. Possible example prefixes: +31, +31(0), (+31)(0), 0, 0031 followed by 9 numbers (which can contain a space or -).

这篇关于荷兰电话号码的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆