in reply to Regex help

This is ugly and untested, but it's what came to mind.
/^([a-z])(?!.*\1) # letter, never followed by the same letter ([a-z])(?!.*\2) # another ([a-z])(?=(?!\3).(?!\3).\3(?!.*\3)) # letter followed by two othe +rs, then itself and never again ([a-z])(?!.*\4) # another of the first type ([a-z])(?!.*\5) # another \3 # the repeated char ([a-z])(?!\6) # another unique char ([a-z])\z # final char /x;
(update: changed ?: to ?=)

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Regex help
by Anonymous Monk on Jun 23, 2007 at 02:16 UTC
    Thanks Roy Johnsonf.

    I ran your code against the dict file containing words with length 8. I didn't get any results - I'm suspecting maybe the word required by the regex doesn't exist.