I am using trufflehog for secret scanning.I need a regex that will scan for the password in a directory.
Regex must cover sample secrets mentioned below:
I tried with the below regex and it is detecting the third password mentioned from above 3, but without a space after the password.(Does not detect if I give the entire line as mentioned in option 3, but works if I remove space and registry.net)
\\b(?=.*[0-9]{2,})(?=.*[a-z]{2,})(?=.*[A-Z]{2,})(?=\\S+$)[^-@#:$%^&+=/,<>()._]{30,33}\\b
Please help me frame 3 different regex to scan these passwords.
You can try:
\b"?(?=[^'"@#^:$%&+=\/,<>()._\s-]*?[a-z])(?=[^'"@#^:$%&+=\/,<>()._\s-]*?[A-Z])(?=[^'"@#^:$%&+=\/,<>()._\s-]*?\d)[^'"@#^:$%&+=\/,<>()._\s-]{20,}"?\b