Alex Balashov writes:
What about some sort of hashing algorithm that
operates on regular
expression sums or is otherwise tuned by regex elements?
the problem is: given a string, find from set of prefixes the longest
one that matches the string. if prefixes are known strings, they can be
organized in a data structure (tree, hash table, etc), where matching is
fast to execute.
if prefixes are regular expressions, i don't know any other solution
than linearly match them one by one to string.
-- juha