Skip to content

Commit a2f4ec2

Browse files
Divyansh Singhsudeepgumaste
andauthored
feat(validation): update regex for DM phone numbers [SI-36293] (#242)
* Update phone number regex for Dominica in data files * Create shy-camels-reflect.md * Delete .changeset/shy-camels-reflect.md * Create modern-files-tan.md --------- Co-authored-by: Sudeep <42863969+sudeepgumaste@users.noreply.github.com>
1 parent 3668617 commit a2f4ec2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.changeset/modern-files-tan.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@razorpay/i18nify-js": patch
3+
---
4+
5+
update regex for DM phone numbers

i18nify-data/phone-number/country-code-to-phone-number/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"DM": {
314314
"dial_code": "+1",
315315
"format": "xxx-xxxx",
316-
"regex": "(?:[58]\\d\\d|767|900)\\d{7}"
316+
"regex": "^(?:(?!767)\\d{7}|767\\d{7})$"
317317
},
318318
"DO": {
319319
"dial_code": "+1",

packages/i18nify-go/modules/phonenumber/data/data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"DM": {
314314
"dial_code": "+1",
315315
"format": "xxx-xxxx",
316-
"regex": "(?:[58]\\d\\d|767|900)\\d{7}"
316+
"regex": "^(?:(?!767)\\d{7}|767\\d{7})$"
317317
},
318318
"DO": {
319319
"dial_code": "+1",

packages/i18nify-js/src/modules/phoneNumber/data/phoneRegexMapper.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"CZ": "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",
6262
"DK": "[2-9]\\d{7}",
6363
"DJ": "(?:2\\d|77)\\d{6}",
64-
"DM": "(?:[58]\\d\\d|767|900)\\d{7}",
64+
"DM": "^(?:(?!767)\\d{7}|767\\d{7})$",
6565
"DO": "(?:[58]\\d\\d|900)\\d{7}",
6666
"EC": "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",
6767
"EG": "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",

0 commit comments

Comments
 (0)