http://www.perlmonks.org?node_id=1214660


in reply to regex for identifying encrypted text

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2:regex for identifying encrypted text
by Eily (Monsignor) on May 16, 2018 at 16:25 UTC

    /\-\-\-\-\-BEGIN ENCRYPTED PRIVATE KEY\-\-\-\-\-(.*?)\-\-\-\-\-END ENCRYPTED PRIVATE KEY\-\-\-\-\-/ will reliably match and capture
    at least it will reliably compile. But . doesn't match \n unless you have the /s option for your regex. You were just one character away from code that actually works.

    A reply falls below the community's threshold of quality. You may see it by logging in.