Skip to content

invalid-regexp

Detect invalid constant regular expressions.

Updated View as Markdown

Default severity: error

Reports invalid constant patterns passed to regular-expression compilation and matching functions. Dynamic patterns are checked at runtime by the standard library and are not reported.

Bad

regexp.MustCompile(`[a-z`)

Good

regexp.MustCompile(`[a-z]+`)
Navigation

Type to search…

↑↓ navigate↵ selectEsc close