Skip to content

Instantly share code, notes, and snippets.

@sroller
Created September 15, 2020 19:54
Show Gist options
  • Save sroller/74e22dcf3c58dafd8da132f71d889f4d to your computer and use it in GitHub Desktop.
Save sroller/74e22dcf3c58dafd8da132f71d889f4d to your computer and use it in GitHub Desktop.
ruby regexp post #2
entry="CN=steffenr,OU=Users,OU=Accounts,DC=big-company,DC=com"
capture=entry.match(/CN=((?:(?!,).)*)/)
capture[1]="steffenr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment