diff --git a/pkg/http.go b/pkg/http.go index b28c413..c0dfe1e 100644 --- a/pkg/http.go +++ b/pkg/http.go @@ -84,14 +84,10 @@ func (wbrc *Archiver) fetch(url string, ch chan<- string) { } func isURL(str string) bool { - re := regexp.MustCompile(`(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,255}\.[a-z]{0,63}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)`) + re := regexp.MustCompile(`https?://?[-a-zA-Z0-9@:%._\+~#=]{1,255}\.[a-z]{0,63}\b(?:[-a-zA-Z0-9@:%_\+.~#?&//=]*)`) match := re.FindAllString(str, -1) - for _, el := range match { - if len(el) > 2 { - return true - } - } - return false + + return len(match) >= 1 } func latest(s string) string {