Skip to content

Hostname should support Internationalized domain name (IDN) TLDs #94

@candita

Description

@candita

Hostname RegEx should support a TLD that exists in the IANA list of TLDs at http://data.iana.org/TLD/tlds-alpha-by-domain.txt,
e.g. XN--11B4C3D, or कॉम.

Currently it disallows numbers and hyphen in the last label of the Hostname (TLD):
^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$

Can I change it to allow digits and hyphens in the TLD, or create a new format called HostnameIDN?
^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z0-9-\p{L}]){2,63})$

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions