From 715d947e4b7dd7ee6eecd726552051618fa97510 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sat, 14 Mar 2026 16:46:45 -0700 Subject: [PATCH] Strip country suffix before address parsing in wizard Handles "United States/USA" at end of address string that was blocking ZIP and state regex extraction. Co-Authored-By: Claude Opus 4.6 --- portal/setup-wizard.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portal/setup-wizard.html b/portal/setup-wizard.html index aabab50..4172843 100644 --- a/portal/setup-wizard.html +++ b/portal/setup-wizard.html @@ -2112,7 +2112,8 @@ console.log('Parsing address:', biz.address); // Parse from the end forward: ZIP (5 digits), then State (2 letters), then City + AddressLine1 - let remaining = biz.address.trim(); + let remaining = biz.address.trim() + .replace(/,?\s*(United States|USA|US|U\.S\.A?\.)?\s*$/i, '').trim(); // Extract ZIP (last 5 digits, optionally with -4) const zipMatch = remaining.match(/\b(\d{5})(?:-\d{4})?\s*$/);