Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IsCIdentifier (0.2 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go

    var cIdentifierRegexp = regexp.MustCompile("^" + cIdentifierFmt + "$")
    
    // IsCIdentifier tests for a string that conforms the definition of an identifier
    // in C. This checks the format, but not the length.
    func IsCIdentifier(value string) []string {
    	if !cIdentifierRegexp.MatchString(value) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 16:08:43 UTC 2024
    - 19K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/validation/validation_test.go

    		"a", "ab", "abc", "a1", "_a", "a_", "a_b", "a_1", "a__1__2__b", "__abc_123",
    		"A", "AB", "AbC", "A1", "_A", "A_", "A_B", "A_1", "A__1__2__B", "__123_ABC",
    	}
    	for _, val := range goodValues {
    		if msgs := IsCIdentifier(val); len(msgs) != 0 {
    			t.Errorf("expected true for '%s': %v", val, msgs)
    		}
    	}
    
    	badValues := []string{
    		"", "1", "123", "1a",
    		"-", "a-", "-a", "1-", "-1", "1_", "1_2",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 05 04:51:54 UTC 2024
    - 22.3K bytes
    - Viewed (0)
Back to top