code: function scan(str, re) {
    var match = null;
    var ret = [];
  
    while (match = re.exec(str)) {
      ret.push(match);
    }
  
    return ret;
  }
docs: Scan `str` with `re`.
  
  @param {String} str
  @param {RegExp} re
  @returns {Array}
  @private