bug-grep
[Top][All Lists]
Advanced

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

Re: Problems using + with -f <file>


From: Benno Schulenberg
Subject: Re: Problems using + with -f <file>
Date: Tue, 11 Jul 2006 23:27:50 +0200
User-agent: KMail/1.9.3

Julian Foad wrote:
> Gert Jan van Loo wrote:
> > If I change my pattern file to:
> > Input [a-zA-Z0-9_]\+ is unused
> > Now using "grep -f <patternfile> <source>" The patterns ARE
> > found. Now using "egrep -f <patternfile> <source>" The patterns
> > are NOT found.
> >
> > egrep seems to do the right thing.
> > I thought "[a-zA-Z0-9_]+" is part of the standard grep.
> > Even if it is not why does \+ suddenly work?
>
> All of this is working as intended,

Hmm, not quite:

$ echo "My source contains many of:
Input location is unused
Input rstn is unused" >file

$ grep --color "Input [A-Za-z]\+" file
Input location is unused
Input rstn is unused

Here "Input" and the word after it are red.

$ grep --color "Input [A-Z]\+" file
Input location is unused
Input rstn is unused

Now there is no color.  What is matched here?  Why are these lines 
getting printed?

Benno




reply via email to

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