Skip to content

Commit

Permalink
fix floor matching
Browse files Browse the repository at this point in the history
  • Loading branch information
kane50613 committed Apr 27, 2024
1 parent 180c12c commit 95d36dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/translate-address-to-english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export function translateAddressToEnglish(
mutableAddress = mutableAddress.replace(numberMatch[0], "");
}

const floorMatch = mutableAddress.match(/(\d+) *樓/);
// match the floor part same as the number part
const floorMatch = mutableAddress.match(/((\d+)(-\d+)?) *樓/);

if (floorMatch?.length) {
parts.push(`${floorMatch[1]}F.`);
Expand Down

0 comments on commit 95d36dc

Please sign in to comment.