develooper Front page | perl.golf | Postings from July 2002

Re: My solution annotated

Thread Previous
From:
Lars Henrik Mathiesen
Date:
July 8, 2002 02:44
Subject:
Re: My solution annotated
Message ID:
20020708094342.31527.qmail@tyr.diku.dk
> Date: Mon, 8 Jul 2002 10:19:42 +0100 (BST)
> From: Stephen Turner <sret1@ntlworld.com>
> 
> # We want to find an earliest node to print. So look for lines finishing
> # " $b", but which don't start "$b ". These stop $b being an earliest
> # node at this point.
> #
> # (I wanted to save two strokes with /(?<!^$b) $b\n/ -- I don't know why
> # it doesn't work.)

It seems that /(?<!^...)/m doesn't fail to match at the start of the
buffer, only when ^ is after a newline. Probably a bug... I wanted to
use the construct too, and then ran out of time to make the solution
work with an alternative.

Lars Mathiesen (U of Copenhagen CS Dep) <thorinn@diku.dk> (Humour NOT marked)

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About