http://www.perlmonks.org?node_id=392973


in reply to Re: nested combinations: algorithm advice?
in thread nested combinations: algorithm advice?

Excellent! I thought there might be a nicer way than the brute-force combinations. Also, using regexes instead of looping on the word lists is nice -- let the regex engine do the dirty work. Thanks for the reply, I will probably steal your ideas. :)

  • Comment on Re^2: nested combinations: algorithm advice?

Replies are listed 'Best First'.
Re^3: nested combinations: algorithm advice?
by bmann (Priest) on Sep 22, 2004 at 18:31 UTC
    Glad you liked it. One caveat though - craft your regex with care if you use this (or use a hash like jasper's version below, which doesn't suffer from this problem). The regex I used was naive in that it doesn't detect the boundary between the words. Add "twop_threep" to DATA, you'll see a false positive.