giggsey/libphonenumber-for-php

brazilian cellphone number is not correctly validated

Closed this issue · 1 comments

the regular expression to validate the official cellphone numbers in brazil is:
"/^([3-9]\d)([9][1-5]\d{7})$|^([3-9]\d)[9]?(\d{8})$|^([1-2]\d)(\d{9})$/"
the phonenumbers without the 9 digit is not being accepted by the library, if the phone has an ddd started by 2 or 1 it is obligated to has the 9 digit, but if is not, it is not obligatory
in the non obligatory cases the 9 digit has to be added to be validated by the lib, it could be done automaticaly

Hi,

Please check the FAQ for checking with invalid numbers.

You'll need to check the number using Google's Demo, then report the issue to them if the number still shows as invalid.