Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: regex for identifying encrypted text

by sundialsvc4 (Abbot)
on May 16, 2018 at 20:49 UTC ( #1214691=note: print w/replies, xml ) Need Help??

in reply to Re: regex for identifying encrypted text
in thread regex for identifying encrypted text

To my reading, the OP implies that the set private key command occurs in a single line which also includes the cipher payload complete with both brackets.   In that case, I think that I would expand upon my previously-suggested regex to include the command, the space and double-quote, and the cipher header bracket ... then proceeding non-greedily to the corresponding footer-bracket and the final quote, knowing that thereby you have got it all.   Substitute an empty-string for the whole thing, and the problem is solved.   Multi-line logic would be only slightly more complicated, and all of it can be buried within a subroutine so that the rest of the program doesn’t have to deal with it.   Because the brackets are there and can be relied-upon, the OP does not have to come up with a “regex for identifying encrypted text.”

Just my two cents ...

  • Comment on Re^2: regex for identifying encrypted text

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214691]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2018-07-22 01:13 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (451 votes). Check out past polls.