Returns true if `regex.match(tagName)` finds a match.

This will use the lowercased tagName for comparison.
function hasMatchingTagName(regex) {
  return function(node) {
    if (!node.tagName) {
      return false;
    }
    return regex.test(node.tagName.toLowerCase());
  };
}