Securityflags: g
Generic API Key
Match generic long alphanumeric tokens (32+ chars) typical of API keys and access tokens.
Try it in RegexProPattern
regexJavaScript
/\b[A-Za-z0-9_\-]{32,}\b/gRaw source: \b[A-Za-z0-9_\-]{32,}\b
How it works
Word-bounded sequence of 32 or more letters, digits, underscores, or hyphens. Broad by design — pair with context (e.g. api_key=) to reduce false positives.
Examples
Input
sk_test_abcdef0123456789abcdef0123456789abcdMatches
sk_test_abcdef0123456789abcdef0123456789abcd
Input
shortNo match
—Common use cases
- Secret scanning in git repos
- DLP for accidental commits
- Log redaction pipelines
- Security audit of config files