On 04/18/2013 10:46 AM, Paul Eggert wrote:
> On 04/18/13 08:24, Eric Blake wrote:
>> {,10} is therefore undefined by POSIX.
>
> It is defined in the grep manual (in the
> node Fundamental Structure), as being
> equivalent to {0,10}, so there does appear
> to be a bug here.
Indeed, we have changed behavior over time; my Fedora 18 box has nicer
behavior:
$ rpm -q grep
grep-2.14-1.fc18.x86_64
$ echo guillaumeeeeeeeguillaume | grep -E "guillaume{,10}gui"
guillaumeeeeeeeguillaume
Guillaume was using grep 2.6.3 on Cygwin. I don't directly see it in
grep's NEWS, although one of these two releases is probably responsible:
2.12:
grep -E 'a{1000000000}' now reports an overflow error rather than
silently acting like grep -E 'a\{1000000000}'.
2.7:
X{0,0} is implemented correctly. It used to be a synonym of X{0,1}.
[bug present since "the beginning"]
At this point, it might be worth asking the Cygwin folks to package a
newer grep, to pick up this (and other) fixes, but there's nothing to do
upstream, unless we want to improve old NEWS entries.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
