Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Oct 2000 14:37:13 -0400
From:      "Andresen,Jason R." <jandrese@mitre.org>
To:        Mark Ovens <marko@FreeBSD.ORG>
Cc:        Christopher Rued <c.rued@xsb.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Perl question
Message-ID:  <39D8D5D9.67A3074B@mitre.org>
References:  <14808.52583.347797.384055@chris.xsb.com> <20001002191537.G252@parish> <20001002192617.I252@parish>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Ovens wrote:
> 
> On Mon, Oct 02, 2000 at 07:15:37PM +0100, Mark Ovens wrote:
> >               /a.?c.*d/;
> 
> Doh, typo! That should read
> 
>                 /a.*?c.*d/;
> 
> BTW, your RE should have a ``*'' as well:
> 
>         /x.*?y/
> 

Maybe, it depends on exactly what he was trying to get.

The first 3 character match where x and y are the first and third
character respectivly, then x.y is exactly what you want.  The smallest
set of characters that have x and y as boundry values?  Then your x.*?y
is correct.  The smallest set of characters that have x and y as
boundries and have at least one character in between them?  x.+?y is
needed.


I'm reminded of the day my daughter came in, looked over my shoulder at
some Perl 4 code, and said, "What is that, swearing?"
             -- Larry Wall in <199806181642.JAA10629@wall.org>


-- 
   _  _    _  ___  ____  ___   ______________________________________
  / \/ \  | ||_ _||  _ \|___| | Jason Andresen -- jandrese@mitre.org
 / /\/\ \ | | | | | |/ /|_|_  | Views expressed may not reflect those 
/_/    \_\|_| |_| |_|\_\|___| | of the Mitre Corporation.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39D8D5D9.67A3074B>