input: Write a python function to validate a UK postcode format.
  assert validate_postcode('EC1A 1BB') == True
  assert validate_postcode('W1A 0AX') == True
  assert validate_postcode('M1 1AE') == True
  assert validate_postcode('B33 8TH') == True
  assert validate_postcode('CR2 6XH') == True
  assert validate_postcode('DN55 1PT') == True
  assert validate_postcode('INVALID') == False
  assert validate_postcode('12345') == False
output: import re
  
  def validate_postcode(postcode):
      pattern = r"^[A-Z]{1,2}[0-9R][0-9A-Z]? ?[0-9][A-Z]{2}$"
      return bool(re.match(pattern, postcode))