Skip to content

Instantly share code, notes, and snippets.

@bradleybeddoes
Created October 13, 2010 06:59
Show Gist options
  • Select an option

  • Save bradleybeddoes/623595 to your computer and use it in GitHub Desktop.

Select an option

Save bradleybeddoes/623595 to your computer and use it in GitHub Desktop.
def subject = "CN=idp1-aaftest.usq.edu.au,OU=Division of ICT,O=University of Southern Queensland,STREET=1 West St.,L=Toowoomba,ST=Queensland,2.5.4.17=#130434333530,C=AU"
def cn = subject =~ /^(?:.*,)*[cC][nN]=([^,]+)(?:,.*)*$/
cn.each {println it}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment