lib/string.js
function runGlobalMatch(str, reg) {
  var result = [], match, lastLastIndex;
  while ((match = reg.exec(str)) != null) {
    if (reg.lastIndex === lastLastIndex) {
      reg.lastIndex += 1;
    } else {
      result.push(match[0]);
    }
    lastLastIndex = reg.lastIndex;
  }
  return result;
}
function runGlobalMatch(str, reg) {
  var result = [], match, lastLastIndex;
  while ((match = reg.exec(str)) != null) {
    if (reg.lastIndex === lastLastIndex) {
      reg.lastIndex += 1;
    } else {
      result.push(match[0]);
    }
    lastLastIndex = reg.lastIndex;
  }
  return result;
}
function runGlobalMatch ( str , reg ) { var result = [ ] , match , lastLastIndex ; while ( ( match = reg . exec ( str ) ) != null ) { if ( reg . lastIndex === lastLastIndex ) { reg . lastIndex += 1 ; } else { result . push ( match [ 0 ] ) ; } lastLastIndex = reg . lastIndex ; } return result ; }
"match" in < IE9 has enumable properties that will confuse for..in loops, so ensure that the match is a normal array by manually running "exec". Note that this method is also slightly more performant.
match in < IE9 has enumable properties that will confuse for .. in loops so ensure that the match is a normal array by manually running exec . Note that this method is also slightly more performant .