In article <3D68324F.A1AE5434@pacbell.net>, Rick Klement <rklement@pacbell.net> writes: > Juho Snellman wrote: >> >> It seems like there should be some exceedingly clever way to do this, >> but I can barely make a one-liner out of it. Can anyone either improve >> this, or figure out a better approach? >> >> #!perl -p >> $a=$_;s/./(sort 7,9,(2..9)x3)[-97+ord lc$&]/ge>=length$\&/^(.)\1+$/and$\=$a}{ > > Just because I've never used tr///s before, I thought I'd try it: > > -p $a=$_;$_=lc;length$\>y/a-z/22233344455566677778889/s|/../ or$\=$a}{ > Save a bit more like this: (hard newline) -ap $_=lc;length$\>y/a-z/22233344455566677778889/s|/../ or$\="@F\n"}{Thread Previous | Thread Next