I\'m trying to build an efficient string matching algorithm. This will execute in a high-volume environment, so performance is critical.
Here are my requirements:
you don't need regexp .. just reverse all the strings, get rid of '*', and put a flag to indicate partial match till this point passes.
Somehow, a trie or suffix trie looks most appropriate.
If the list of domains is known at compile time, you may look at tokenizing at '.' and using multiple gperf generated machines.
Links: google for trie http://marknelson.us/1996/08/01/suffix-trees/