Skip to content

Instantly share code, notes, and snippets.

@fionn
Created September 1, 2023 15:44
Show Gist options
  • Save fionn/63edc956461747b31e6c5a273179e010 to your computer and use it in GitHub Desktop.
Save fionn/63edc956461747b31e6c5a273179e010 to your computer and use it in GitHub Desktop.
Hyperscan-compatible regex patterns for private keys
(-----BEGIN ([A-Z0-9]+ )?PRIVATE KEY-----)(\s*[A-Za-z0-9+/\r\n]+={0,2})(\s*-----END ([A-Z0-9]+ )?PRIVATE KEY-----)
(-----BEGIN PGP PRIVATE KEY BLOCK-----)(\s*.*)*(\s*[A-Za-z0-9+/\r\n]+={0,2})(\s*-----END PGP PRIVATE KEY BLOCK-----)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment