remove the ability to start an Index, Frame, ColumnLabel, or RowLabel with a number

This commit is contained in:
Travis 2017-04-29 16:49:23 -05:00
parent 692d997cab
commit b0fa067ffc
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9
2 changed files with 4 additions and 2 deletions

View file

@ -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",

View file

@ -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.