What mashigan wrote may well be best suited to your exact purpose. Another possibility at least worth a shout out is `collections/critbits` which implements an efficient `keysWithPrefix`. For more fuzzy still than prefix matching, you could also do some kind of efficient edit distance-based thing, but data-structures to (attempt to) optimize that are complicated. (There is `std/editdistance`, though).
- Fuzzy matching on table keys lqdev
- Re: Fuzzy matching on table keys mashingan
- Re: Fuzzy matching on table keys cblake