On Sep 11, igp_list2@tesco.net said: >On Mon, 11 Sep 2000 at 13:24:02 +0100, Leon Brocard wrote: >> Philip Newton sent the following bits through the ether: >> > or FWP >> Well, here's as good a start as any: > >> % perl -ne 'print if $_=~/(.)\1(.)\2(.)\3/' /usr/dict/words >> bookkeeper >> bookkeepers >> bookkeeping > > perl -ne '/((.)\2){3}/&&print' /usr/dict/words >(I wondered if this would work, and it surprised me a little that it >did.) If you look at the -mre=debug output, you'll see why: compiling RE `((.)\2){3}' size 16 first at 7 1: CURLYX {3,3}(15) 3: OPEN1(5) 5: OPEN2(7) 7: ANY(8) 8: CLOSE2(10) 10: REF2(12) 12: CLOSE1(14) 14: WHILEM(0) 15: NOTHING(16) 16: END(0) You'll find that $2 is the last letter repeated. Just as if you'd done: "alphabet" =~ /(.)+/; $1 is 't', not 'a'. -- Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/ PerlMonth - An Online Perl Magazine http://www.perlmonth.com/ The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/ CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/ ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe