atom feed7 messages in org.freebsd.freebsd-questionsRe: Perl question
FromSent OnAttachments
Christopher RuedOct 2, 2000 11:00 am 
Mark OvensOct 2, 2000 11:15 am 
Mark OvensOct 2, 2000 11:25 am 
Andresen,Jason R.Oct 2, 2000 11:36 am 
Christopher RuedOct 2, 2000 2:09 pm 
Mark OvensOct 2, 2000 3:34 pm 
Dirk MyersOct 2, 2000 7:21 pm 
Subject:Re: Perl question
From:Andresen,Jason R. (jand@mitre.org)
Date:Oct 2, 2000 11:36:51 am
List:org.freebsd.freebsd-questions

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 <1998@wall.org>

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