'Validate a phone number.'

def clean(self, value):

    super(CAPhoneNumberField, self).clean(value)
    if (value in EMPTY_VALUES):
        return u''
    value = re.sub('(\\(|\\)|\\s+)', '', smart_unicode(value))
    m = phone_digits_re.search(value)
    if m:
        return (u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3)))
    raise ValidationError(self.error_messages['invalid'])
