2018-02-05 16:05:59 -05:00
|
|
|
package names // import "github.com/docker/docker/daemon/names"
|
2015-10-20 13:09:48 -04:00
|
|
|
|
|
|
|
import "regexp"
|
|
|
|
|
|
|
|
// RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names.
|
|
|
|
const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`
|
|
|
|
|
|
|
|
// RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters.
|
2016-11-23 14:45:35 -05:00
|
|
|
var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`)
|