docs: function(regex, text){
      var nextIndex = 0;
      var result = [];
  
      var execResult;
      while ((execResult = regex.exec(text))!== null) {
          result.push({
              start: execResult.index, 
              matchLength: execResult[0].length});
      }
  
      return {
          next: function(){
              return nextIndex < result.length ?
                  result[nextIndex++] :
                  null;
          }
      };
  }