diff --git a/frame_test.go b/frame_test.go index a6001e8d2..fc5c01570 100644 --- a/frame_test.go +++ b/frame_test.go @@ -91,6 +91,7 @@ func TestFrame_NameValidation(t *testing.T) { } invalidFrameNames := []string{ "", + "123abc", "x.y", "_foo", "-bar", @@ -131,6 +132,7 @@ func TestFrame_RowLabelValidation(t *testing.T) { "UPPERCASE", } invalidRowLabels := []string{ + "123abc", "x.y", "_foo", "-bar", diff --git a/pilosa.go b/pilosa.go index 6271bd8fa..dd7402677 100644 --- a/pilosa.go +++ b/pilosa.go @@ -47,10 +47,10 @@ var ( ) // Regular expression to validate index and frame names. -var nameRegexp = regexp.MustCompile(`^[a-z0-9][a-z0-9_-]{0,64}$`) +var nameRegexp = regexp.MustCompile(`^[a-z][a-z0-9_-]{0,64}$`) // Regular expression to validate row and column labels. -var labelRegexp = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]{0,64}$`) +var labelRegexp = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_-]{0,64}$`) // ColumnAttrSet represents a set of attributes for a vertical column in an index. // Can have a set of attributes attached to it.