def validateClassNames(self, element_obj):
    """ Remove class names which are ignore in id generation.
        Validate class value according to ID generation rule.
    """
try:
    class_names = element_obj.attrib['class']
except:
    return False, ''
class_list = [class_vlaue for class_vlaue in class_names.split(' ') if 
    class_vlaue not in self.ignore_values and bool(self.id_validation.match
    (class_vlaue))]
if len(class_list) != 0:
    return True, class_list
return False, ''
HTML ID value validation by RE