{"record":{"id":"9f4ce7868389f170","repo":"caddyserver/caddy","slug":"invalid-regexp-name-must-contain-only-word-charac-9f4ce7","errorCode":null,"errorMessage":"invalid regexp name (must contain only word characters): %s","messagePattern":"invalid regexp name \\(must contain only word characters\\): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/matchers.go","lineNumber":190,"sourceCode":"\n\tcompiled *regexp.Regexp\n}\n\n// Provision compiles the regular expression which may include placeholders.\nfunc (mre *MatchRegexp) Provision(caddy.Context) error {\n\trepl := caddy.NewReplacer()\n\tre, err := regexp.Compile(repl.ReplaceAll(mre.Pattern, \"\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"compiling matcher regexp %s: %v\", mre.Pattern, err)\n\t}\n\tmre.compiled = re\n\treturn nil\n}\n\n// Validate ensures mre is set up correctly.\nfunc (mre *MatchRegexp) Validate() error {\n\tif mre.Name != \"\" && !wordRE.MatchString(mre.Name) {\n\t\treturn fmt.Errorf(\"invalid regexp name (must contain only word characters): %s\", mre.Name)\n\t}\n\treturn nil\n}\n\n// Match returns true if input matches the compiled regular\n// expression in m. It sets values on the replacer repl\n// associated with capture groups, using the given scope\n// (namespace).\nfunc (mre *MatchRegexp) Match(input string, repl *caddy.Replacer) bool {\n\tmatches := mre.compiled.FindStringSubmatch(input)\n\tif matches == nil {\n\t\treturn false\n\t}\n\n\t// save all capture groups, first by index\n\tfor i, match := range matches {\n\t\tkeySuffix := \".\" + strconv.Itoa(i)\n\t\tif mre.Name != \"\" {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/matchers.go#L172-L208","documentation":"Error \"invalid regexp name (must contain only word characters): %s\" thrown in caddyserver/caddy.","triggerScenarios":"Thrown at modules/caddytls/matchers.go:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only word characters (letters, digits, underscore) in the regexp capture group name."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}