Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: nested combinations: algorithm advice?

by revdiablo (Prior)
on Sep 22, 2004 at 16:50 UTC ( #392973=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://392973]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2020-10-28 09:50 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (260 votes). Check out past polls.