'Validates format and validation digit.
The official format is [X.]XXX.XXX-X but usually dots and/or slash are
omitted so, when validating, those characters are ignored if found in
the correct place. The three typically used formats are supported:
[X]XXXXXXX, [X]XXXXXX-X and [X.]XXX.XXX-X.'

def clean(self, value):

    value = super(UYCIField, self).clean(value)
    if (value in EMPTY_VALUES):
        return u''
    match = self.regex.match(value)
    if (not match):
        raise ValidationError(self.error_messages['invalid'])
    number = int(match.group('num').replace('.', ''))
    validation_digit = int(match.group('val'))
    if (not (validation_digit == get_validation_digit(number))):
        raise ValidationError(self.error_messages['invalid_validation_digit'])
    return value
