bug-grep
[Top][All Lists]
Advanced

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

Re: GNU grep back references


From: Bob Proulx
Subject: Re: GNU grep back references
Date: Sun, 30 Oct 2005 16:00:17 -0700
User-agent: Mutt/1.5.9i

Jan Schampera wrote:
> Julian Foad <address@hidden> wrote:
> > It seems that SVR4's Grep, if it is intentionally treating the whole
> > input as one long string, is in any case wrongly taking the
> > back-reference to refer to the _first_ string matched by the
> > subexpression.
> With my new information I fully agree with that.
> 
> We found that behaviour by some user asking for matching numbers like
> used in my example, and we couldn't find a clear answer which behaviour
> the standard-writers *expected*.

For what it is worth and as another data point the HP-UX grep behaves
the same as GNU grep.

  printf "12\n\n11\n32\n33\n" | grep "\([[:digit:]]\)\1"
  11
  33

Bob




reply via email to

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