wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
    const matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
    this.getTextNodes(dict => {
      dict.nodes.forEach(node => {
        node = node.node;
        let match;
        while (
          (match = regex.exec(node.textContent)) !== null &&
          match[matchIdx] !== ''
        ) {
          if (this.opt.separateGroups && match.length !== 1){
            node = this.separateGroups(
              node,
              match,
              matchIdx,
              filterCb,
              eachCb
            );
          } else {
            if (!filterCb(match[matchIdx], node)) {
              continue;
            }
            let pos = match.index;
            if (matchIdx !== 0) {
              for (let i = 1; i < matchIdx; i++) {
                pos += match[i].length;
              }
            }
            node = this.wrapGroups(node, pos, match[matchIdx].length, eachCb);
          }
          // reset index of last match as the node changed and the
          // index isn't valid anymore http://tinyurl.com/htsudjd
          regex.lastIndex = 0;
        }
      });
      endCb();
    });
  }
Wraps the instance element and class around matches within single HTML
elements in all contexts
@param {RegExp} regex - The regular expression to be searched for
@param {number} ignoreGroups - A number indicating the amount of RegExp
matching groups to ignore
@param {Mark~wrapMatchesFilterCallback} filterCb
@param {Mark~wrapMatchesEachCallback} eachCb
@param {Mark~wrapMatchesEndCallback} endCb
@access protected