What are the best string matching algorithms to search several patterns at once? [closed]

StackOverflow https://stackoverflow.com/questions/23348661

  •  11-07-2023
  •  | 
  •  

Вопрос

What are the best string matching algorithms which can be used to search multiple patterns within a string?

Это было полезно?

Решение

For looking for exact match to a number of different strings I favour the Aho-Corasick string matching algorithm, but there are a number of possible contenders, depending on what your patterns are. One starting point to see what is around in practical use would be look at the different variants of grep mentioned on Wikipedia or pointed to from there.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top