Re: [PATCH 1/2] tests: fix unportable "\?" and "\+" regex syntax
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 22, 2019, 05:00 UTC
- Message-ID
- <xmqqa7ios9hr.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190221192849.6581-2-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 11 quoted lines
> Fix widely supported but non-POSIX basic regex syntax introduced in > [1] and [2]. On GNU, NetBSD and FreeBSD the following works: > > $ echo xy >f > $ grep 'xy\?' f; echo $? > xy > 0 > > The same goes for "\+". The "?" and "+" syntax is not in the BRE > syntax, just in ERE, but on some implementations it can be invoked by > prefixing the meta-operator with "\", but not on OpenBSD:
Yup, thanks for testing, spotting and fixing. I do recall finding one of these during my review during recent couple of cycles, but apparently eyeballing will not always catch everything X-<.