mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-04 06:36:30 +08:00
12 lines
240 B
Go
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
|
|
}
|