Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2:regex for identifying encrypted text

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


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

/\-\-\-\-\-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.

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

Replies are listed 'Best First'.
Re^3: regex for identifying encrypted text
by sundialsvc4 (Abbot) on May 16, 2018 at 20:40 UTC

    “Well, foo!”   Edited the post.   Is that right now?   Or, if you prefer, post a correction.   Thanks.

    (Anyhow, mostly I was driving for the general idea:   that you can and should rely on the brackets and use them for this intended purpose.)

      That's better, thanks. We all told skendric to use the delimiters one way or another, with a useful addition from hippo stating that it can only be done if you try to do that before the delimiting lines are removed by the diff tool.

      brackets? what brackets? do you know what a bracket is?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-08-17 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (176 votes). Check out past polls.

    Notices?