Regular Expressions 101

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^[0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2}$
/

Description

A regex for the brazilian document named of CNPJ (Cadastro Nacional de Pessoa Jurídica)

Submitted by André Ramos (github.com/andrelramos) - 9 years ago