go 校验网址格式是否合法
func VerifyUrl(url string) bool {
reg_url := regexp.MustCompile(`(https|http|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]`)
//re := regexp.MustCompile(`(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?`)
result_url := reg_url.FindAllStringSubmatch(url, -1)
if len(result_url) == 0 {
return false
}
return true
}