ac_matcher
is a simple Excel Add-in written in VBA and C++ which has two macros for pattern matching with Aho-Corasick algorithm.
xlut_MATCH(ByVal value As String, ByVal patternRange As Range, Optional ByVal longestLeft As Boolean = False) As Variant
Works like MATCH. If longestLeft
is True
, returns the index of longest matched pattern.
xlut_VLOOKUP(ByVal value As String, ByVal patternRange As Range, ByVal columnIndex As Long, Optional ByVal longestLeft As Boolean = False) As Variant
Works like VLOOKUP. If longestLeft
is True
, returns the index of longest matched pattern.
To speed up the lookup, the patterns given by the Range are cached which means the function result won't reflect the changes you make to the patterns.