bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep RE repetition match curiosity


From: Stepan Kasal
Subject: Re: grep RE repetition match curiosity
Date: Thu, 15 Sep 2005 09:56:18 +0200
User-agent: Mutt/1.4.1i

Hello,

On Wed, Sep 14, 2005 at 04:47:58PM -0700, Chris Beecroft wrote:
> Given the file:
> ab
> azb
> azzb
> 
> the regular expression pattern "az{0}b" acts as "az{0,1}b", i.e.,
> returns the first two lines
> 
> likewise "az{0,0}b" acts like "az{0,1}b" and returns the first two lines
> where only the first line should be expected.

I have reproduced the bug on my machine, and I have also reproduced it
in gawk 3.1.5:

$ echo azb|awk --re-interval '/az{0}b/'
azb

But I wasn't able to reproduce it with sed 4.1.4 (called with option -r).
And gawk's sub() also works correctly:

$ echo azb|awk --re-interval '{sub(/az{0}b/,"X")}1'
azb

This indicates that the bug is in the dfa.c code.

We'll look at details later.

Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]