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

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

I think I may have found a regex bug in a recent version of grep?


From: Steve Ingram
Subject: I think I may have found a regex bug in a recent version of grep?
Date: Mon, 7 Jun 2004 20:37:47 -0700
User-agent: KMail/1.6.2

Hi There,

I am running this version of grep

address@hidden > grep --v
grep (GNU grep) 2.5.1

What I am trying to do is exclude lines
in a file that contain a period followed
by a lowercase letter.

I have attached my data file.

Here is a sample run though....

address@hidden > cat data.txt
EntityType.ID_Rod.ProperName = Gas Main
EntityType.ID_Rod.status.ProperName                = Status

These two are not what I expect....

address@hidden > grep -v "\.[a-z]" data.txt
address@hidden >

address@hidden > grep -v "\.[a-z]*" data.txt
address@hidden >

But these two work.

address@hidden > grep -v "\.[a-z]t" data.txt
EntityType.ID_Rod.ProperName = Gas Main
address@hidden >

address@hidden > grep "\.[a-z]t" data.txt
EntityType.ID_Rod.status.ProperName                = Status
address@hidden >


However, if I use grep version 2.4.2 (Linux and Mac), everything seems fine

I fully appreciate my regex knowledge may not be up to par though :)

Let me know if you need any other info or let me know
if you'd rather not hear from me again :)

cheers!

s.

Attachment: data.txt
Description: Text document


reply via email to

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