git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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-<.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 17 of 25 in “[ANNOUNCE] Git v2.21.0-rc2”
  1. Junio C HamanoFeb 19, 2019
  2. Randall S. BeckerFeb 20, 2019
  3. Junio C HamanoFeb 20, 2019
  4. Johannes SchindelinFeb 20, 2019
  5. Duy NguyenFeb 21, 2019
  6. brian m. carlsonFeb 21, 2019
  7. Duy NguyenFeb 22, 2019
  8. Randall S. BeckerFeb 21, 2019
  9. Junio C HamanoFeb 21, 2019
  10. SZEDER GáborFeb 21, 2019
  11. Randall S. BeckerFeb 21, 2019
  12. Randall S. BeckerFeb 21, 2019
  13. Git for Windows v2.21.0-rc2, was Re: [ANNOUNCE] Git v2.21.0-rc2Johannes Schindelin, Feb 21, 2019
  14. 0/2 BSD portability fixes for 2.21.0-rc2Ævar Arnfjörð Bjarmason, Feb 21, 2019
  15. Josh SteadmonFeb 22, 2019
  16. 1/2 tests: fix unportable "\?" and "\+" regex syntaxÆvar Arnfjörð Bjarmason, Feb 21, 2019
  17. Junio C HamanoFeb 22, 2019
  18. 2/2 commit-graph tests: fix cryptic unportable "dd" invocationÆvar Arnfjörð Bjarmason, Feb 21, 2019
  19. SZEDER GáborFeb 21, 2019
  20. Ævar Arnfjörð BjarmasonFeb 21, 2019
  21. SZEDER GáborFeb 22, 2019
  22. Ævar Arnfjörð BjarmasonFeb 22, 2019
  23. Junio C HamanoFeb 22, 2019
  24. Todd ZullingerFeb 22, 2019
  25. commit-graph tests: fix unportable "dd" invocationJunio C Hamano, Feb 22, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.