Wildcard string matching

后端 未结 9 1523
醉话见心
醉话见心 2021-01-02 01:54

What is the most efficient wildcard string matching algorithm? I am asking only about an idea, it is not necessary to provide actual code.

I\'m thinking that such al

9条回答
  •  耶瑟儿~
    2021-01-02 02:32

    There is a paper covering the fastest options here http://swtch.com/~rsc/regexp/regexp1.html in particular it allows you avoid naive algorithms that become pathologically slow when long patterns are used.

    It covers generic regular expressions but you can limit your implementation to the subset you require.

提交回复
热议问题