{"record":{"id":"89b99acbd1dcff65","repo":"goharbor/harbor","slug":"fuzzy-match-value-must-start-with-and-contain","errorCode":null,"errorMessage":"fuzzy match value must start with \"~\" and contain at least 1 other characters","messagePattern":"fuzzy match value must start with \"~\" and contain at least 1 other characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/q/builder.go","lineNumber":122,"sourceCode":"\t}\n\tswitch value[0] {\n\tcase '~':\n\t\treturn parseFuzzyMatchValue(value)\n\tcase '[':\n\t\treturn parseRange(value)\n\tcase '{':\n\t\treturn parseOrList(value)\n\tcase '(':\n\t\treturn parseAndList(value)\n\tdefault:\n\t\t// others: exact match\n\t\treturn escapeValue(value), nil\n\t}\n}\n\nfunc parseFuzzyMatchValue(value string) (*FuzzyMatchValue, error) {\n\tif len(value) < 2 || value[0] != '~' {\n\t\treturn nil, fmt.Errorf(`fuzzy match value must start with \"~\" and contain at least 1 other characters`)\n\t}\n\treturn &FuzzyMatchValue{\n\t\tValue: value[1:],\n\t}, nil\n}\n\nfunc parseRange(value string) (*Range, error) {\n\tlength := len(value)\n\tif value[length-1] != ']' || strings.Count(value, \"~\") != 1 {\n\t\treturn nil, fmt.Errorf(`range must start with \"[\", end with \"]\" and contains only one \"~\"`)\n\t}\n\tstrs := strings.SplitN(value[1:length-1], \"~\", 2)\n\tminVal := strings.TrimSpace(strs[0])\n\tmaxVal := strings.TrimSpace(strs[1])\n\tif len(minVal) == 0 && len(maxVal) == 0 {\n\t\treturn nil, fmt.Errorf(`min and max at least one should be set in range'`)\n\t}\n\tr := &Range{}","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/lib/q/builder.go#L104-L140","documentation":"Error \"fuzzy match value must start with \"~\" and contain at least 1 other characters\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/lib/q/builder.go:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}