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

Function isUsernameValid

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

Source from the content-addressed store, hash-verified

311}
312
313func isUsernameValid(username string) bool {
314 // assuming valid usernames are alphanumeric, with these special characters allowed: . _ -
315 var validUsernamePattern = `^[a-zA-Z0-9_][-.a-zA-Z0-9_]*$`
316 re := regexp.MustCompile(validUsernamePattern)
317 return re.MatchString(username)
318}
319
320// Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL
321func isJupyterServerURLValid(serverURL string) bool {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected