Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcards broken? #6

Open
flowchartsman opened this issue May 29, 2014 · 0 comments
Open

Wildcards broken? #6

flowchartsman opened this issue May 29, 2014 · 0 comments

Comments

@flowchartsman
Copy link

This library does not properly parse wildcards, it seems:

Using the following code:

package main
import (
    "github.com/joeguo/tldextract"
    "fmt"
)

func main() {
    var test string
    var err error
    tld, _:= tldextract.New("/tmp/tldcache.txt",false)

    for err == nil {
        fmt.Printf("string: ")
        fmt.Scanf("%s\n", &test)
        result := tld.Extract(test)
        if result.Flag == tldextract.Malformed {
            fmt.Println("Error", result)
        } else {
            fmt.Printf("%s.%s\n", result.Root, result.Tld)
        }
    }
}

I get:

string: http://foo.bar.com
bar.com
string: http://foo.co.uk
Error &{0   }
string: http://foo.*.uk
foo.*.uk

The "foo.*.uk" is most certainly incorrect.

@flowchartsman flowchartsman changed the title doesn't seem to work for .co.uk Wildcards broken? May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant