Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created March 9, 2016 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/41bc5b4f94daf3658b3a to your computer and use it in GitHub Desktop.
Save anonymous/41bc5b4f94daf3658b3a to your computer and use it in GitHub Desktop.
s="CN=TestCorp Demo Issuing CA,O=TestCorp"
print /CN=(?<CN>[^\|]+?),?O[ID|=]/.match(s)[0]
>>CN=TestCorp Demo Issuing CA,O=
Instead of
>>TestCorp Demo Issuing CA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment