trufflehogregexes is a Python package that provides the core regular expressions used by the TruffleHog secrets scanner. It offers a structured list of dictionaries, each containing a regex pattern, ID, name, and tags for various sensitive information. Currently at version 0.0.7, it has a low release cadence, primarily serving as a data dependency for the main TruffleHog application.
pip install trufflehogregexesVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to import and inspect the `regexes` list. It also shows a basic way to iterate and apply one of the regexes using Python's `re` module, as the package only provides the patterns, not the matching logic.
Access the `regexes` list directly after importing: `from trufflehogregexes import regexes` then `regexes[0]` or `len(regexes)`.
Use `import re` and then `re.search(entry['regex'], text)` to perform matching with the provided patterns.
When consuming regex entries, use `.get()` for dictionary access (e.g., `entry.get('regex')`) to gracefully handle potentially missing keys after an upgrade. Monitor the GitHub repository for updates if relying on specific entry fields.No dependency data recorded yet.