Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: OT: How to find anagrams?by eric256 (Parson) |
on Apr 27, 2004 at 23:50 UTC ( [id://348672]=note: print w/replies, xml ) | Need Help?? |
You could further restrict the search to only words that contain those and only those letters. Thats a fairly quick regex with a character class and you've significantly reduced your word sets. MySQL (if you have your database in that) will even let you use regex in a query although i don't know if that will be faster or slower than doing them on your end. I had a program once that took a set of rules and found all words that matched them, it could normaly be done in a single SQL statment but adding a temporary table saved a lot of time and shoehorning. :) What is your source of words? ___________ Eric Hodges
In Section
Seekers of Perl Wisdom
|
|