I’ve been for a while trying to setup a regex in mysql where it finds words from a dictionary table whose letters are in set.
Giving a set of letters i.e. “freedom” I want to get what combination of words i can obtain from such set of letters:
The result should be something like:
“free”, “dom”, “fee”, “freedom”, “red” and so on….
Is it possible using regex?
Thanks in advance.
It’s definitely NOT possible using regex.
It IS possible, though, using a combination of combinatorics & a really good wordlist.
In a few words : what you’re trying to do IS both challenging and difficult, but there could be a way…
What I would do :
For combinatorics which you may need, have a look at my answer here : PHP take all combinations (you’ll do it in PHP, right?)
For a good wordlist, you could start by having a look at here : http://homepage.ntlworld.com/adam.bozon/scrabblelists.htm (I hope it’s not too overwhelming)