RJK wrote: > On Wed, Jul 07, 1999 at 10:51:20AM -0400, John Porter wrote: > > RJK wrote: > > > Counting variations, I have 26 words which fit (including those from the > > > original puzzle). > > On the other hand, I have been humbled by the list of words Ken Pizzini > posted for 'abcde': he found 18 words which contain 'abcde' consecutively. > My word list only has 8. So, where did you find the 26? > > while ( /[a-e](?=[a-e]{4})/g ) { > > I especially like the use of look-ahead to match four characters. Yep, this is one of those situations where it's really useful. On reflection, I think I would rather have done this: while (<F>) { while ( /[a-e](?=[a-e]{4})/g ) { join( '', sort split //, substr $_, pos()-1, 5 ) eq 'abcde' and print and last; } } It's actually noticeably faster. John Porter ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe