in reply to Re: Simple regex wordlist question
in thread Simple regex wordlist question

I think he is working on the puzzle where you think of as many words that can be spelled using letters in the given word. But what about quantity?

I've already given ++ to Zaxo and CountZero for their anagram solutions, but I'm not sure now that's the point

An example would help, but if I'm right, he wants, given 'PerlMonks' a list like:

But would not like 'reel', as there are not two 'e's in the input.

Is this what johngg has?

perhaps vcTheGuru is closer to right with Math::Combinatorics, except maybe using the combine function looping from 1..($#input+1).


I humbly seek wisdom.

Replies are listed 'Best First'.
Re^3: Simple regex wordlist question
by goibhniu (Hermit) on Sep 11, 2007 at 21:00 UTC

    The following needs a great deal of polish. I took ikegami's basic regexp as a superset of the words you're looking for. Then I horribly misused it without all the safety that ikegami was right to include (qr// syntax, etc.).

    I also ended up turning your semantic inside out in that the dictionary file is now on the command line and the starting word is hard coded; sorry about that.

    The guts of this solution involve counting letters in a regexp:


    I humbly seek wisdom.