awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

Allowing Perl Compatible Regex #146

Closed hugofragata closed 4 years ago

hugofragata commented 4 years ago

Solves #145

Makes expressions Perl compatible by calling grep with the -P instead of the -E flag. Basically, git grep -nwHEI, grep -Ev and grep -d "${action}" -nwHEI calls now are run with -nwHPI and -Pv flags. Affected functions: scan_history, git_grep, regular_grep, process_output. This doesn't break backwards compatibility since Perl Compatible Regex is a superset of Extended Regex. Also, README.rst and secrets.1 now specify that PCRE is supported.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

hugofragata commented 4 years ago

I'll close this PR, make some changes and re-open when passing the tests locally.

AlbertoConchas commented 3 years ago

i have problems with Lookahead when i add regex is this fix not ready yet?