Skip to content

Instantly share code, notes, and snippets.

@bensternthal
Created February 21, 2014 18:15
Show Gist options
  • Save bensternthal/9139934 to your computer and use it in GitHub Desktop.
Save bensternthal/9139934 to your computer and use it in GitHub Desktop.
I want to get the list of bugs mentioned in a commit message! Essentially the same regex used here but in Javasctipt: https://github.com/github/github-services/blob/master/lib/services/bugzilla.rb#L139
//I hate regex. Here is what I have so far.
var testString = "fix bug 3524";
var regex1 = new RegExp("/(?:close|fix|address)*?(?=(?:ticket|bug|tracker item|issue)*?)/","i");
var result = regex1.exec(testString);
if (result) {
console.log(result);
} else {
console.log('no match!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment