Expose DomainRegexp from reference

This fix is based on:
https://github.com/docker/docker/pull/30746#discussion_r99650885

The goal is to reuse the `DomainRegexp` in docker to check
for `<host>:<port>` pattern.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2017-02-07 17:43:28 -08:00
parent b1993c9530
commit 95daa793b8
2 changed files with 6 additions and 6 deletions

View file

@ -116,7 +116,7 @@ func TestDomainRegexp(t *testing.T) {
match: true,
},
}
r := regexp.MustCompile(`^` + domainRegexp.String() + `$`)
r := regexp.MustCompile(`^` + DomainRegexp.String() + `$`)
for i := range hostcases {
checkRegexp(t, r, hostcases[i])
}