Skip to content

Instantly share code, notes, and snippets.

@weeksdev
Created April 21, 2014 15:39
Show Gist options
  • Select an option

  • Save weeksdev/11146341 to your computer and use it in GitHub Desktop.

Select an option

Save weeksdev/11146341 to your computer and use it in GitHub Desktop.
Javascript RegEx Test
var myString = "CN=BlamoMan,OU=Associates,DC=prod-am,DC=ameritrade,DC=com";
var myRegexp = /CN=(.*?),[A-Z]/g;
var match = myRegexp.exec(myString);
if(match){
alert(match[1].replace(/\\/,''));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment