detecting email addresses? #1386
Answered
by
rgmz
ethoms-usgs
asked this question in
Q&A
-
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.
Answered by
rgmz
Apr 6, 2024
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.
2 replies
Answer selected by
ethoms-usgs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 = ["@"]