function getSelectors(selector) {
  const selectors = selector.split(/ (?=(?:(?:[^"]*"){2})*[^"]*$)/);
  return selectors.reduce((list, sel) => list.concat(sel), []);
}

function findAllVNodes(vNode, nodes = [], first) {
  if (!first) {
    nodes.push(vNode);
  }

  if (vNode.children && vNode.children.length > 0) {
    for (let i = 0; i < vNode.children.length; i++) { // eslint-disable-line no-plusplus
      findAllVNodes(vNode.children[i], nodes);
    }
  }

  if (vNode.child) {
    findAllVNodes(vNode.child._vnode, nodes);
  }

  return nodes;
}

function getMatchingNodes(vNode, selector, first) {
  const nodes = findAllVNodes(vNode, [], first);
  return nodes.filter((node) => {
    if (node.elm && node.elm.matches) {
      return node.elm.matches(selector);
    }
    return false;
  });
}

function recurseGetMatchingVNodes(vNodes, selectors, first) {
  const nodes = [];

  vNodes.forEach(node => nodes.push(...getMatchingNodes(node, selectors[0], first)));

  if (selectors.length <= 1) {
    return nodes;
  }

  return recurseGetMatchingVNodes(nodes, selectors.splice(0, 1), true);
}

export default function findMatchingVNodes(vNode, selector) {
  const selectorsArray = getSelectors(selector);
  if (selectorsArray.length > 1) {
    return recurseGetMatchingVNodes([vNode], selectorsArray);
  }
  return getMatchingNodes(vNode, selector);
}


@@ -209,29 +209,49 @@
 %5B%5D, 
-first) %7B%0A  if (!first
+ignoreFirstNode) %7B%0A  if (!ignoreFirstNode
 ) %7B%0A
@@ -581,32 +581,33 @@
 tion getMatching
+V
 Nodes(vNode, sel
@@ -613,21 +613,31 @@
 lector, 
-first
+ignoreFirstNode
 ) %7B%0A  co
@@ -673,21 +673,31 @@
 de, %5B%5D, 
-first
+ignoreFirstNode
 );%0A  ret
@@ -892,21 +892,31 @@
 ectors, 
-first
+ignoreFirstNode
 ) %7B%0A  co
@@ -978,24 +978,25 @@
 .getMatching
+V
 Nodes(node, 
@@ -1013,13 +1013,23 @@
 0%5D, 
-first
+ignoreFirstNode
 )));
@@ -1391,16 +1391,17 @@
 Matching
+V
 Nodes(vN

Refactor findMatchingVNodes