regex-le 0.3.1

Find every regex in a codebase, and report which can be driven into catastrophic backtracking
1
2
3
4
5
6
7
8
9
10
11
12
package main

import "regexp"

var (
	// A backquoted string is the source verbatim
	nested = regexp.MustCompile(`(a+)+`)
	// A quoted string escapes a level
	escaped = regexp.Compile("\\d{2}:\\d{2}")
	// Inline flags: valid RE2, and not JavaScript
	inline = regexp.MustCompile(`(?i)^[a-z]+$`)
)