Regular Expressions 101

Community Patterns

BR Phone

1

Regular Expression
Python

r"
(?:(?<=^)|(?<=\D))((00|\+)?55(\s|\.|-)*)?((\()?0?\d{2}(?(5)\)|)(\s|\.|-)*)?(9(\s|\.|-)*)?\d{4}(\s|\.|-)*\d{4}(?=\D|$)
"
gm

Description

get all attempts to write brazilian phone numbers

Submitted by rafaelverger - 8 years ago