Files
go-easy-utils/validx/url.go
2025-07-08 15:26:54 +08:00

12 lines
240 B
Go

package validx
import (
"regexp"
)
// IsURL 是否为URL地址
func IsURL(url string) bool {
match, _ := regexp.MatchString(`^(http|https)://[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$`, url)
return match
}