Created
September 12, 2013 08:56
-
-
Save tsmd/6534703 to your computer and use it in GitHub Desktop.
RFC1035 に準拠していたりしなかったりする、ドメインの正規表現
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 先頭の数字は許可する(RFC的にはNG)、連続したハイフンは許可する(RFC的にはOKだが多くのレジストラは禁止している) | |
var domainReg = /^[0-9a-z]([-0-9a-z]*[0-9a-z])?(\.[0-9a-z]([-0-9a-z]*[0-9a-z])?)+$/i; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment