11 lines · 247 B · Go
RawDownload
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)}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t