Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: regex for word puzzleby muba (Priest) |
on Jun 13, 2005 at 00:49 UTC ( [id://466017]=note: print w/replies, xml ) | Need Help?? |
What thou needest, fellow monk who shall rename unnamed and anonymous, shall be not a regular expression. No, instead you'll need some kind of a loop construct. I don't know how good your math is, but with a word of 9 letters, there are 9! = 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 combination. This is because at the first position there are nine possible letters. The second position has only 8 possible letters and so on. Your task will be to write a loop than can create all these combinations. And regex won't do that for you, AFAIK. "2b"||!"2b";$$_="the question" Besides that, my code is untested unless stated otherwise. One more: please review the article about regular expressions (do's and don'ts) I'm working on. magnum unum bovem audivisti
In Section
Seekers of Perl Wisdom
|
|