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

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}

Replies are listed 'Best First'.
Re^6: Regex help
by Anonymous Monk on Jun 24, 2007 at 03:03 UTC
    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...

      ...and a newline :-) use chomp on each line, or use the -l switch.

      --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}