bug-grep
[Top][All Lists]
Advanced

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

Re: lowercase letters for binaries


From: Charles Levert
Subject: Re: lowercase letters for binaries
Date: Sun, 6 Nov 2005 19:47:15 -0500
User-agent: Mutt/1.4.1i

* On Sunday 2005-11-06 at 23:51:12 +0100, Andreas Schwab wrote:
> Charles Levert <address@hidden> writes:
> 
> > * On Sunday 2005-11-06 at 22:48:30 +0100, Andreas Schwab wrote:
> >> only in BREs which don't have alternation.
> >
> > Is that the justification?
> 
> I don't understand your question, but my point is that if you don't have
> alternation (and neither optional matches) the group referenced by a
> back-reference has always matched something fixed.

Well, no, as my example showed.  It contained
a bracket expression, [xy], and these are
not fixed, are allowed in BREs, and are the
equivalent of an alternation like (x|y).

So, consider '([[:alpha:]])z\1' and
it can become very cumbersome to write
'AzA|aza|BzB|...|ZzZ|zzz', and that's only
for the C locale.  Or consider '([^x])z\1'
with an UTF-8 locale.

   bash$ echo "☺z☺" | grep -E '([^x])z\1'; echo $?
   ☺z☺
   0
   bash$ echo "☺z☹" | grep -E '([^x])z\1'; echo $?
   1

Hence, my question was:  is that the
justification used by the POSIX committee when
they standardized on this behavior for EREs?
Because that justification seems to only rely
on something merely being possible (modulo the
maximum length of a command line), but still
being potentially very impractical.




reply via email to

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