We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3b0129 commit 2e8bf1aCopy full SHA for 2e8bf1a
1 file changed
pkg/util/encoding/encoding.go
@@ -34,9 +34,8 @@ func Convert(ID string) string {
34
return SafeConcatName(ID)
35
}
36
37
-// UnsafeNameRegEx checks for a valid name and needs to be url compatible
38
-var UnsafeNameRegEx = regexp.MustCompile(`^[a-z0-9][a-z0-9\-]+[a-z0-9]$`)
39
-var UnsafeUpperNameRegEx = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9\-_]+[A-Za-z0-9]$`)
+var UnsafeNameRegEx = regexp.MustCompile(`^[a-z0-9]+(?:-?[a-z0-9]+)*$`)
+var UnsafeUpperNameRegEx = regexp.MustCompile(`^[A-Za-z0-9]+(?:[\-_]?[A-Za-z0-9])*$`)
40
41
func IsUnsafeUpperName(unsafeName string) bool {
42
return !UnsafeUpperNameRegEx.MatchString(unsafeName)
0 commit comments