域名可以有两个连续的连字符吗 [英] Can domain name have two continuous hyphens

查看:59
本文介绍了域名可以有两个连续的连字符吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SO上查询了几个问题,这似乎表明不允许使用两个连续的连字符(例如my--website.com),但是当我在使用正则表达式对URL/域进行验证?(铁轨)

I looked up couple of questions on SO, which seem to suggest that two continuous hyphens (e.g. my--website.com) are not allowed but when I search for same domain name on http://www.register.com/index.rcmx, it gladly accepts the name while rejects non valid domain names like my#website.com.
Validation for URL/Domain using Regex? (Rails)

推荐答案

在域名中这是合法的,并且是国际化域名(IDN)所必需的IDN从Unicode转换为ASCII时最终以 xn开头

It's legal in a domain name, and required for internationalised domain names (IDNs) which when converted from Unicode to ASCII end up prefixed with xn--

这篇关于域名可以有两个连续的连字符吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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