xChauncey has asked for the wisdom of the Perl Monks concerning the following question:
I'm sure it is easy to see what I am trying to do here, but obviously I have something wrong. Once I get the regex right, I would like to dynamically generate the regex for each word and then map the results so that the next word only looks at words that match the letters seen for the last word (but that's the next phase). This will be a recursive process, so that if the prog hits a roadblock (from thinking that one of the words is something it really isn't) it will go back and try something else.#!Perl open INPUT, "<dictionary"; open OUTPUT, ">result.txt"; while (<INPUT>){ if ($_ =~ m/^(.)([^\1])([^\1\2])([^\1\2\3])([^\1\2\3\4])\5/i){ print OUTPUT "$&\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cryptquote solver
by blakem (Monsignor) on Jun 29, 2003 at 10:33 UTC | |
|
•Re: cryptquote solver
by merlyn (Sage) on Jun 29, 2003 at 15:17 UTC | |
by waswas-fng (Curate) on Jun 30, 2003 at 03:05 UTC | |
|
Re: cryptquote solver
by sauoq (Abbot) on Nov 13, 2003 at 10:50 UTC | |
|
Re: cryptquote solver
by BrowserUk (Patriarch) on Jun 30, 2003 at 07:07 UTC |