[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] 4 Consecutive Letters




Ronald J Kimball wrote:
> 
> On Mon, Aug 14, 2000 at 11:29:04AM -0500, Tim Ayers wrote:
> >
> > Ronald's first solution seems to be able to be modified to be shorter:
> >
> >      perl -ne'@a=a..z;for$i(0..22){print,last if/@a[$i..$i+3]/x}'
> 
> I can't believe I didn't see that.

This is two characters longer, but I thought it was fun that it used no
visible variables so here it is.

    perl -ne'print,last if join("",a..z)=~join"|",/(?=(....))/g,_'

-- 
Rick Delaney
rick.delaney@home.com

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe