Fast matching, e.g. for autocompletes