Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix BR Regex
Browse files Browse the repository at this point in the history
For some reason, all REGEX was using \\d instead of \d... this should fix the problem. 
And Brazilian numbers changed mobile numbers to begin with an 9 before the area code... fixed this regex too.
  • Loading branch information
rwrz committed Aug 30, 2018
1 parent c6c465a commit 8286d72
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Validator/PhoneNumber/BR.php
Expand Up @@ -11,19 +11,19 @@
'code' => '55',
'patterns' => [
'national' => [
'general' => '/^[1-46-9]\\d{7,10}|5\\d{8,9}$/',
'fixed' => '/^1[1-9][2-5]\\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}$/',
'mobile' => '/^1(?:1(?:5[347]|[6-8]\\d|9\\d{1,2})|[2-9][6-9]\\d)\\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[6-9]\\d{7}$/',
'tollfree' => '/^800\\d{6,7}$/',
'premium' => '/^[359]00\\d{6,7}$/',
'shared' => '/^[34]00\\d{5}$/',
'general' => '/^[1-46-9]\d{7,10}|5\d{8,9}$/',
'fixed' => '/^1[1-9][2-5]\d{7}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\d{7}$/',
'mobile' => '/^1(?:1(?:5[347]|[6-8]\d|9\d{1,2})|[2-9][6-9]\d)\d{6}|(?:[4689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])9[6-9]\d{7}$/',
'tollfree' => '/^800\d{6,7}$/',
'premium' => '/^[359]00\d{6,7}$/',
'shared' => '/^[34]00\d{5}$/',
'emergency' => '/^1(?:12|28|9[023])|911$/',
],
'possible' => [
'general' => '/^\\d{8,11}$/',
'mobile' => '/^\\d{10,11}$/',
'shared' => '/^\\d{8}$/',
'emergency' => '/^\\d{3}$/',
'general' => '/^\d{8,11}$/',
'mobile' => '/^\d{10,11}$/',
'shared' => '/^\d{8}$/',
'emergency' => '/^\d{3}$/',
],
],
];

0 comments on commit 8286d72

Please sign in to comment.