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


in reply to regex for identifying encrypted text

(1) Suggestions on how to construct such a regex?

Very difficult to avoid false positives because the last line of the key may only be a few characters.

(2) Suggestions on how to tackle the problem differently?

Text::Diff will happily work on arrays/scalars as well as files, so pre-process your inputs to remove any private keys before doing the diff - that way they are easy to identify.

  • Comment on Re: regex for identifying encrypted text