Maybe word-regexp is not needed?
- Dominant language
- Shell
- Stars
- 13.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I've just tried `git secrets` and it took me quite a while to understand what my regex is not working.
For example:
```
engine = create_engine('postgresql://admin:password@db-url/db-name')
```
And from `man grep`:
```
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
```
And I've used this regex `postgresql:\/\/[a-z]*_(ro|rw|admin):[a-z0-9]+@`, which was not working.
Maybe I don't understand, but it seems that with `-w` grep care about the code context.
But I think `git secrets` should not care about entire line, but only about matching regex in the line.
Thanks, you've created very helpful tool
Contributor guide
Assessment
This issue has not been assessed yet.