Make sure rule.selectorText exists before doing the regular expression