This is a real world task which can be solved in a couple of lines.
Which makes me think that you guys can do it in about half a line!
The simple version of the task is to verify that each line of a file is the
insertion of one character somewhere (maybe at the start or the end) into the
prior li
> My first thought was HART: Hospelian Arabic to Roman Transform.
>Remembering this old "ton is an alien" thread, I now propose "Earthman":
Eye-popping Alien Roman Ton Hospelian Magical Algorithm for Numerals
> If you can think of a better name, please let us know. :-)
I don't know of any val
Phil Carmody said:
> This is a real world task which can be solved in a couple of lines.
> Which makes me think that you guys can do it in about half a line!
Phil Carmody said:
> This is a real world task which can be solved in a couple of lines.
> Which makes me think that you guys can do it in about half a line!
Not exactly half a line, but still not too bad:
#!perl -lp
$p=~s/\B|\b/(.)?/g;/^$p$/;
$p=$_;$_=(@m=grep/./,@-)[EMAIL PROTECTED]:die"brok
In article <[EMAIL PROTECTED]>,
Phil Carmody <[EMAIL PROTECTED]> writes:
> This is a real world task which can be solved in a couple of lines.
> Which makes me think that you guys can do it in about half a line!
>
> The simple version of the task is to verify that each line of a file is t
In response to Phil Carmody <[EMAIL PROTECTED]> saying:
> > The simple version of the task is to verify that each line of a file is the
> > insertion of one character somewhere (maybe at the start or the end) into
> > the prior line.
--- Ton Hospel <[EMAIL PROTECTED]> wrote:
<<<
-p0 $_ x=/^((.*)(
In article <[EMAIL PROTECTED]>,
Phil Carmody <[EMAIL PROTECTED]> writes:
> In response to Phil Carmody <[EMAIL PROTECTED]> saying:
>> > The simple version of the task is to verify that each line of a file is the
>> > insertion of one character somewhere (maybe at the start or the end) into
Phil Carmody <[EMAIL PROTECTED]> writes:
> -p0 s/^((.*)(.*)
> (?=\2.\3
> |$))*$//
Assuming the last line is also newline-terminated:
-n0 a//^((.*)(.*
)(?=\2.\3|$))*$/
--
Juho Snellman
--- Juho Snellman <[EMAIL PROTECTED]> wrote:
> Phil Carmody <[EMAIL PROTECTED]> writes:
> > -p0 s/^((.*)(.*)
> > (?=\2.\3
> > |$))*$//
>
> Assuming the last line is also newline-terminated:
Fair assumption
> -n0 a//^((.*)(.*
> )(?=\2.\3|$))*$/
Kiitos, Juho.
That's gone beyond my perl ken! Was
On Tue, Jan 16, 2007 at 04:59:51PM -0800, Phil Carmody wrote:
> --- Juho Snellman <[EMAIL PROTECTED]> wrote:
> > Phil Carmody <[EMAIL PROTECTED]> writes:
> > > -p0 s/^((.*)(.*)
> > > (?=\2.\3
> > > |$))*$//
> >
> > Assuming the last line is also newline-terminated:
>
> Fair assumption
>
> > -n0
10 matches
Mail list logo