diff --git a/index.js b/index.js index db69554..9f758f0 100644 --- a/index.js +++ b/index.js @@ -32,9 +32,11 @@ function expandMatcher (matcher) { } if (className) { - attributes.class = new RegExp(getCombinations(className.split(".")).map(function(order){ - return "(?:^|\\s)" + order.join("\\s(?:.*?\\s)?") + "(?:\\s|$)"; - }).join("|")); + try { + attributes.class = new RegExp(getCombinations(className.split(".")).map(function(order){ + return "(?:^|\\s)" + order.join("\\s(?:.*?\\s)?") + "(?:\\s|$)"; + }).join("|")); + } catch { } } if (attributes) {