We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a8927f commit 2a1f38cCopy full SHA for 2a1f38c
pkg/http.go
@@ -84,14 +84,10 @@ func (wbrc *Archiver) fetch(url string, ch chan<- string) {
84
}
85
86
func isURL(str string) bool {
87
- 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@:%_\+.~#?&//=]*)`)
88
match := re.FindAllString(str, -1)
89
- for _, el := range match {
90
- if len(el) > 2 {
91
- return true
92
- }
93
94
- return false
+
+ return len(match) >= 1
95
96
97
func latest(s string) string {
0 commit comments