Skip to content

Instantly share code, notes, and snippets.

@fantactuka
Created November 21, 2012 09:36
Show Gist options
  • Save fantactuka/4123991 to your computer and use it in GitHub Desktop.
Save fantactuka/4123991 to your computer and use it in GitHub Desktop.
Quick iterating through string matching
"Hello world".replace(/[aeoiu]/g, function(match, matchIndex) {
console.log(match, matchIndex);
});
// -> e, 1
// -> o, 4
// -> o, 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment