offline indexing over an ordered set of strings for wildcard searching
I want to implement a wildcard search feature to a large but finite set of strings
here is what I want: ? for 1 char, * for 0 or more chars.
What I've already known:

 1. use trie, or variants of trie can solve the problem pretty good,
    WITHOUT * matching
 2. although use a reversed trie do solve * problem, by coupling match
    results of both tries, yet I want the strings to be "alphabetically"
    ordered, and memory used by intersection calculating could be
    serious.

similar problems have found at [http://www.codechef.com/JAN10/problems/L2][1], but I can't find somebody explains their codes.

Thanks

  [1]: http://www.codechef.com/JAN10/problems/L2
offline indexing over an ordered set of strings for wildcard searching
===

I want to implement a wildcard search feature to a large but finite set of strings
here is what I want: ? for 1 char, * for 0 or more chars.
What I've already known:

 1. use trie, or variants of trie can solve the problem pretty good,
    WITHOUT * matching
 2. although use a reversed trie do solve * problem, by coupling match
    results of both tries, yet I want the strings to be "alphabetically"
    ordered, and memory used by intersection calculating could be
    serious.

similar problems have found at [http://www.codechef.com/JAN10/problems/L2][1], but I can't find somebody explains their codes.

Thanks

  [1]: http://www.codechef.com/JAN10/problems/L2