Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: regex for identifying encrypted text

by Eily (Prior)
on May 16, 2018 at 10:22 UTC ( #1214630=note: print w/replies, xml ) Need Help??


in reply to regex for identifying encrypted text

That looks like Base64 encoding. There are clues that can help you identify those lines (64 chars wide, except maybe the last, the chars are only those allowed by Base64 (no space), etc...) but since you have "BEGIN ENCRYPTED PRIVATE KEY", I'm guessing you might also have an END. If that's the case, the better solution might be to ignore all the lines between those two tokens. Using the "from..to" version of the .. operator, this could be something like: next LINE if ($line=~/BEGIN ENCRYPTED/)..($line=~/END ENCRYPTED/);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214630]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2018-12-16 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (71 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!