detecting email addresses? #1386
-
I would like to find email addresses with a custom rule I have added to .gitleaks.toml. I have a regex that works at Regex101, but I get no reports when running gitleaks. My rule
which detects a couple fake addresses at Regex101
I have other custom rules in .gitleaks.toml which DO trigger warnings, so it's clear that the file is getting evaluated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The
As an aside, I would recommend adding keywords to make your rule more efficient. keywords = ["@"] |
Beta Was this translation helpful? Give feedback.
The
$
character means "end of line", so your pattern won't work if there is anything after it. It also won't detect emails that contain upper-case characters (the fix is https://stackoverflow.com/a/34219588).As an aside, I would recommend adding keywords to make your rule more efficient.
keywords = ["@"]