mirror of
https://github.com/rclone/rclone.git
synced 2024-12-04 22:34:48 +01:00
12 lines
247 B
Go
12 lines
247 B
Go
package check
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
// HostAndPort checks whether a string contains host and port.
|
|
// It returns true if matched.
|
|
func HostAndPort(hostAndPort string) bool {
|
|
return regexp.MustCompile(`^[^:]+:[0-9]+$`).MatchString(hostAndPort)
|
|
}
|