fix regex matching on classes