The regular expression to remove the starting and ending parts from a certificate PEM string would be:
/-----BEGIN CERTIFICATE-----(.*)-----END CERTIFICATE-----/s
This regular expression matches the starting string -----BEGIN CERTIFICATE-----
, followed by any characters (captured using the parentheses and the .*
expression), and then the ending string -----END CERTIFICATE-----
. The s
flag at the end of the regex allows the dot character to match newlines as well.
Asked: 2021-06-29 11:00:00 +0000
Seen: 9 times
Last updated: Jul 30 '21