Sponsors

There are currently no sponsors. Become a sponsor today!

0

Java 8

"

(\d){3}\.?\1{3}\.?\1{3}-?\1{2}

"

gm

It matches CPF (Cadastro de Pessoa Física) with all digits as the same number.

Since CPF consists in a pattern ###.###.###-##, or ###########, and # being a single digit, this document cannot have all the 11 (eleven) digits as the same number. Therefore 000.000.000.000-00 would not be an example of a CPF, since all 11 digits are the same number, in this case 0 (zero). This regular expression matches this case, where the cpf have all digit as the same number.

Submitted by TheRockSaysOP - 2 years ago (Last modified 2 years ago)