{"record":{"id":"217af263c0f69108","repo":"projectdiscovery/nuclei","slug":"could-not-compile-regex-s-s","errorCode":null,"errorMessage":"could not compile regex %s: %s","messagePattern":"could not compile regex (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/scope/scope.go","lineNumber":23,"sourceCode":"\t\"fmt\"\n\t\"net/url\"\n\t\"regexp\"\n)\n\n// Manager manages scope for crawling process\ntype Manager struct {\n\tinScope    []*regexp.Regexp\n\toutOfScope []*regexp.Regexp\n\tnoScope    bool\n}\n\n// NewManager returns a new scope manager for crawling\nfunc NewManager(inScope, outOfScope []string) (*Manager, error) {\n\tmanager := &Manager{}\n\n\tfor _, regex := range inScope {\n\t\tif compiled, err := regexp.Compile(regex); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not compile regex %s: %s\", regex, err)\n\t\t} else {\n\t\t\tmanager.inScope = append(manager.inScope, compiled)\n\t\t}\n\t}\n\tfor _, regex := range outOfScope {\n\t\tif compiled, err := regexp.Compile(regex); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not compile regex %s: %s\", regex, err)\n\t\t} else {\n\t\t\tmanager.outOfScope = append(manager.outOfScope, compiled)\n\t\t}\n\t}\n\tif len(manager.inScope) == 0 && len(manager.outOfScope) == 0 {\n\t\tmanager.noScope = true\n\t}\n\treturn manager, nil\n}\n\n// Validate returns true if the URL matches scope rules","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/internal/server/scope/scope.go#L5-L41","documentation":"Error \"could not compile regex %s: %s\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at internal/server/scope/scope.go:23 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":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}