If you haven't already run across them, see Doug McIlroy's paper on NFA/DFA's and code for suffix arrays: http://www.cs.dartmouth.edu/~doug/nfa.ps.gz http://www.cs.dartmouth.edu/~doug/sarray/ -Dave