in reply to Re^3: Regex help
in thread Regex help

Thanks again.

I tried your code on a dict file of words with length 8. Here're some of the results:

... abetters (not ok, t is repeated too) abigails (not ok) abillity (not ok, l is repeated too) abscises (not ok, s repeated more than twice) abscisin (not ok, i is repeated too) abscisse (not ok) acaudate (not ok) ...
The result list is about 3300 words. I scanned through about 200 and couldn't find one that fits the regex...Maybe the word doesn't exist in the list...

Replies are listed 'Best First'.
Re^5: Regex help
by shmem (Chancellor) on Jun 23, 2007 at 06:42 UTC
    Did you run exactly the code I posted? You must have some cut'n'paste error. My result list is 776 words and none of those you report are included.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      This is what I've:
      # I didn't have the length == 8 line because # I'm only reading one file containing 8-letter words while (<FH>) { $c = substr ($_, 2, 1); if (substr ($_, 5, 1) eq $c) { my %h; @h{split//,$_} = (1) x 8; print if keys %h == 7; } }
        That is not the code I posted. Mine begins with:
        #!/usr/bin/perl -nl

        See perlrun for command line switches. You are matching words with 6 unique letters...

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}