Hashtable/dictionary/map lookup with regular expressions

前端 未结 19 1289
难免孤独
难免孤独 2021-02-01 05:36

I\'m trying to figure out if there\'s a reasonably efficient way to perform a lookup in a dictionary (or a hash, or a map, or whatever your favorite language calls it) where the

19条回答
  •  迷失自我
    2021-02-01 06:19

    The problem has nothing to do with regular expressions - you'd have the same problem with a dictionary with keys as functions of lambdas. So the problem you face is figuring is there a way of classifying your functions to figure which will return true or not and that isn't a search problem because f(x) is not known in general before hand.

    Distributed programming or caching answer sets assuming there are common values of x may help.

    -- DM

提交回复
热议问题