Community Patterns

Community Library Entry

2

Regular Expression
Created·2021-07-07 20:29
Flavor·Python

r"
^(\+55)?[\s]?\(?(\d{2})?\)?[\s-]?(9?\d{4}[\s-]?\d{4})$
"
gm
Open regex in editor

Description

Permite filtrar e capturar telefones brasileiros seguindo o modelo:

Código internacional (+55) caso fornecido

DDD (XX)

Telefone fixo (XXXX-XXXX) ou telefone móvel com ou sem o "9" inicial (9XXXX-XXXX)

Submitted by https://github.com/leonsp95