{"record":{"id":"1e22bcde3c9a45e9","repo":"mikefarah/yq","slug":"i-is-not-a-valid-option-for-match-to-ignore-cas","errorCode":null,"errorMessage":"'i' is not a valid option for match. To ignore case, use an expression like match(\"(?i)cat\")","messagePattern":"'i' is not a valid option for match\\. To ignore case, use an expression like match\\(\"\\(\\?i\\)cat\"\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/operator_strings.go","lineNumber":410,"sourceCode":"\n\t// we got given parameters e.g. match(exp; params)\n\tif expressionNode.RHS.Operation.OperationType == blockOpType {\n\t\tblock := expressionNode.RHS\n\t\tregExExpNode = block.LHS\n\t\treplacementNodes, err := d.GetMatchingNodes(context, block.RHS)\n\t\tif err != nil {\n\t\t\treturn nil, matchPrefs, err\n\t\t}\n\t\tparamText := \"\"\n\t\tif replacementNodes.MatchingNodes.Front() != nil {\n\t\t\tparamText = replacementNodes.MatchingNodes.Front().Value.(*CandidateNode).Value\n\t\t}\n\t\tif strings.Contains(paramText, \"g\") {\n\t\t\tparamText = strings.ReplaceAll(paramText, \"g\", \"\")\n\t\t\tmatchPrefs.Global = true\n\t\t}\n\t\tif strings.Contains(paramText, \"i\") {\n\t\t\treturn nil, matchPrefs, fmt.Errorf(`'i' is not a valid option for match. To ignore case, use an expression like match(\"(?i)cat\")`)\n\t\t}\n\t\tif len(paramText) > 0 {\n\t\t\treturn nil, matchPrefs, fmt.Errorf(`unrecognised match params '%v', please see docs at https://mikefarah.gitbook.io/yq/operators/string-operators`, paramText)\n\t\t}\n\t}\n\n\tregExNodes, err := d.GetMatchingNodes(context.ReadOnlyClone(), regExExpNode)\n\tif err != nil {\n\t\treturn nil, matchPrefs, err\n\t}\n\tlog.Debug(NodesToString(regExNodes.MatchingNodes))\n\tregExStr := \"\"\n\tif regExNodes.MatchingNodes.Front() != nil {\n\t\tregExStr = regExNodes.MatchingNodes.Front().Value.(*CandidateNode).Value\n\t}\n\tlog.Debugf(\"regEx %v\", regExStr)\n\tregEx, err := regexp.Compile(regExStr)\n\treturn regEx, matchPrefs, err","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/operator_strings.go#L392-L428","documentation":"extractMatchArguments parses the optional params string of match/capture/test (e.g. match(exp; params)). After stripping 'g' (global), any remaining 'i' is explicitly rejected: Go's regexp supports inline case-insensitive flags, so the canonical fix the error prescribes is to embed (?i) in the pattern rather than pass an 'i' param.","triggerScenarios":"Thrown at pkg/yqlib/operator_strings.go:410 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an inline flag in the pattern: match(\"(?i)cat\")","Keep 'g' if you need all matches: match(\"(?i)cat\"; \"g\")","Remove 'i' from the params argument entirely"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}