,

Brazilian postcodes


File:Brazilian_flag.png

Brazilian Postcode Format

00000-000
Use numbers only

Sao Paulo postcode -- example

Begining with 0, the postcode, or CEP as we call it, would be a variation of the following:
CEP: 07500-000

CEP: What is it?

Postal code in Brazil is know as CEP (C├│digo de Endere├žamento Postal - translated as "Code of Postal Addressing")

  • CEP validate expression:([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})-?([0-9]{3})

Official structure for CEP

  • The CEP is structured under the decimal system and it's composed of: Region, Subregion, Sector, Subsector and the three distribution identifiers.
  • The regions are composed with one or more states (or countries) and follow the list bellow:
    • Region 0: Sao Paulo's metropolitan area
    • Region 1: Sao Paulo's country side
    • Region 2: Rio de Janeiro and Espirito Santo
    • Region 3: Minas Gerais
    • Region 4: Bahia and Sergipe
    • Region 5: Pernambuco, Alagoas, Pernambuco and Rio Grande do Norte
    • Region 6: Ceara, Piaui, Maranha, Paraiba, Amazonas, Acre, Amapa and Roraima
    • Region 7: Distrito Federal, Goiania, Tocantins, Matogrosso, Matogrosso do Sul and Rondonia
    • Region 8: Parana and Santa Catarina
    • Region 9: Rio Grande do Sul


How to write Brazilian address

File:pdf-icon.gif How to write a letter to Brazil using Brazilian Postal Addresses - quick guide


For developers

Regex CEP Brasil

([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})-?([0-9]{3})

Example

<?php

$cep = "90050-320";

preg_match("/^([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})-?([0-9]{3})$/i" ,$cep,$postcode);

print_r($postcode,true);

?>

Output

Array
(
[0] => 90050-320
[1] => 9
[2] => 0
[3] => 0
[4] => 5
[5] => 0
[6] => 320
)