MCPcopy Index your code
hub / github.com/cli/cli / isUsernameValid

Function isUsernameValid

internal/codespaces/rpc/invoker.go:308–313  ·  view source on GitHub ↗
(username string)

Source from the content-addressed store, hash-verified

306}
307
308func isUsernameValid(username string) bool {
309 // assuming valid usernames are alphanumeric, with these special characters allowed: . _ -
310 var validUsernamePattern = `^[a-zA-Z0-9_][-.a-zA-Z0-9_]*$`
311 re := regexp.MustCompile(validUsernamePattern)
312 return re.MatchString(username)
313}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected