Skip to content

Commit

Permalink
Fix phone number parsing when last 4 digits start with X
Browse files Browse the repository at this point in the history
  • Loading branch information
mapomatic committed Aug 11, 2024
1 parent 8c7b284 commit 68d79f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion WME-Place-Harmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2854,7 +2854,7 @@
// normalize phone
function normalizePhone(s, outputFormat) {
if (isNullOrWhitespace(s)) return s;
s = s.replace(/(\d{3}.*)\W+(?:extension|ext|xt|x).*/i, '$1');
s = s.replace(/(\d{3}.*[0-9A-Z]{4})\W+(?:extension|ext|xt|x).*/i, '$1');
let s1 = s.replace(/\D/g, ''); // remove non-number characters

// Ignore leading 1, and also don't allow area code or exchange to start with 0 or 1 (***USA/CAN specific)
Expand Down

0 comments on commit 68d79f9

Please sign in to comment.