matchBrand

Matches the free-form brand string a location carries to a merchant.

Used only where a location carries no merchant association. Matching is case-insensitive with a leading "the " stripped from both sides, and continues only at a word boundary so "Best" does not match "Besties".

The best match wins, not the first one the catalogue happens to list: an exact name beats every partial one, and among partial matches the longest merchant name wins. Otherwise a catalogue holding both "Best" and "Best Buy" would pin a Best Buy to "Best" - the wrong merchant, and with it the wrong cash-back rate, silently.