diff --git a/xurls.go b/xurls.go index 4113b07..0cfa087 100644 --- a/xurls.go +++ b/xurls.go @@ -75,7 +75,7 @@ const ( `)` ipv6Addr = `(?:` + ipv6AddrMinusEmpty + `|::)` ipAddrMinusEmpty = `(?:` + ipv6AddrMinusEmpty + `|\b` + ipv4Addr + `\b)` - port = `(?::[0-9]*)?` + port = `(?::[0-9]+)?` ) // AnyScheme can be passed to StrictMatchingScheme to match any possibly valid diff --git a/xurls_test.go b/xurls_test.go index cf1dbf5..e09cc5f 100644 --- a/xurls_test.go +++ b/xurls_test.go @@ -328,6 +328,7 @@ func TestRegexes(t *testing.T) { {`"foo.com/bar"`, `foo.com/bar`}, {`what is foo.com?`, `foo.com`}, {`the foo.com!`, `foo.com`}, + {`check of foo.com: ok`, `foo.com`}, {`foo@bar`, nil}, {`foo@bar.a`, nil},