readRegexReturnCapture_(regex, index) {
    if (this.atEnd()) {
      return null;
    }

    const ret = this.readRegex(regex);
    if (!ret) {
      return null;
    } else {
      return ret[index];
    }
  }
Reads a regex from the parser and returns the given capture.

@param {!RegExp} regex
@param {number} index
@return {?string}
@private