Skip to content

LPM Question #157

@davegreeko2023

Description

@davegreeko2023

Hi there, I apologize in advance if I am asking at the wrong place. I have a very large lookup table (this table can be sorted) and I wanted to find the longest prefix match of an input string.

let lookup_table :Vec<(&str,u32,u8)> = vec![("+96171",1001,1),("+9617",1002,2),("+961",1003,3)];

If I have an input string like "+961712345678" I must return ("+96171",1001,1) tuple only. Is this something I can do with fst crate? and if so, an example is very much appreciated.
Regards,
Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions