def validate_phone_number(value):
 value = value.replace(' ', '')
 value = re.sub('^00', '+', value)
 pattern = re.compile('^\\+\\d{5,15}$')
 if (not pattern.match(value)):
  raise ValidationError(_('Please enter a valid phone number in international format (e.g. +1 555 555 5555)'))
 return value

def validate_phone_number ( value ) : value = value . replace ( ' ' , '' ) value = re . sub ( '^00' , '+' , value ) pattern = re . compile ( '^\\+\\d{5,15}$' ) if ( not pattern . match ( value ) ) : raise ValidationError ( _ ( 'Please enter a valid phone number in international format (e.g. +1 555 555 5555)' ) ) return value
validate that a phone number is in international format .