package main
import (
"fmt"
"regexp"
)
func main() {
s := `https://www.collectivesolver.com/search?q=go`
re := regexp.MustCompile(`^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)`)
matches := re.FindAllString(s,-1)
for _, element := range matches {
fmt.Println(element)
}
}
/*
run:
https://www.collectivesolver.com
*/