Skip to content

Split www.ox.ac.uk into [Subdomain([www]), Domain(ox), Tld([ac, uk])].

Notifications You must be signed in to change notification settings

skial/domain-parser

Repository files navigation

Domain

A domain name parser.

This expects only the domain, www.google.com, not http://www.google.com/?query#hash, use a URI parser first.

Data

public_suffix_list.dat.txt is from publicsuffix.org site. This is used to generate uhx.types.Domain.hx.

Api

enum DomainParts {
    Tld(parts:Array<String>);
    Domain(name:String);
    Subdomain(parts:Array<String>);
}

Domain API

International ccTLD's, like 中国 for China, return the same list as cn would.

class Domain {
    
    public static function initialize():Void;
    public static function parse(domain:String, ?tlds:Array<String->Bool>, ?slds:Array<String->Bool>):haxe.ds.Option<Array<DomainParts>>;
    
}

About

Split www.ox.ac.uk into [Subdomain([www]), Domain(ox), Tld([ac, uk])].

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages