Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-11-30 15:39
Flavor·PCRE2 (PHP)

/
(?ms)(\s*((?<privatekey>-----BEGIN .* PRIVATE KEY-----.*?-----END .* PRIVATE KEY-----)|(?<certificate>-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----))\s*){2}
/
gm
Open regex in editor

Description

Identify and group Certificate and Private Key from a combination PEM file

Submitted by @rbleattler