in reply to Scrabble Word Regex Challenge

I think that using a regexp to solve this is using a sledgehammer to crack a nut. It can be done easily for problem (1) as long as the regexp packge you use allows for numbered repetition counts, eg "a(7)" meaning 0 to 7 letter a's. You'ld need to presort the word before testing it.

The obvious implementation using an array of letter counts will be faster and more elegant. (A regexp solution may well mean shorter source code, but that equates with elegance only if you ignore what it's doing behind the scenes...)

I'm reasonably sure that a regexp solution allowing for two blanks will explode in size.

By the way on (3) there are two classic solutions that will be hard to beat: a) use a DAWG (Directed Acyclic Word Graph) or depending on space/speed requirements, one of the tweaked versions of same; and b) use an 'anagram dictionary' where your wordlist is keyed by an alpha sort of the letters, eg 'elpr => perl' in combination with a permutation generator.

If you can come up with anything new I'll be happy to list the code on the wordgame-programmers web site :-)

regards

Graham Toal (www.gtoal.com/wordgames/scrabble.html)