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

Re: git bug: Perl compatible regular expressions do not work as expected

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 28, 2023, 13:47 UTC
Message-ID
<xmqqsfdpj8ci.fsf@gitster.g>
In-Reply-To
<xmqqjzz1nalp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> I suspect that 54463d32ef was done in a conservative way to avoid
> unintended side effects to make ERE "enhanced".  I am not 100%
> certain, but after reading the documentation you pointed at, I do
> not see a valid expression without ENHANCED flag starting to mean
> totally different thing with it (well, an extra '?' turning a
> pattern from greedy to minimal may count as such a change in
> semantics, but I do not see anybody sensible adding an extra '?'
> in a pattern in the first place).

Sorry, but that is nonsense. We cannot avoid being backward incompatible if we suddenly flip the "enhanced" bit for BRE. A sane pattern written expecting non-enhanced BRE can change its meaning when the "enhanced" mode is enabled.

But if "enhanced" is what users want, and if that is what the other tools on the platform use, then perhaps flipping the "enhanced" bit may not be a bad idea.

Previous: Junio C HamanoNext: René Scharfe
Message 11 of 18 in “git bug: Perl compatible regular expressions do not work as expected”
  1. Mario GrgicMar 25, 2023
  2. Kristoffer HaugsbakkMar 25, 2023
  3. Mario GrgicMar 25, 2023
  4. demerphqMar 25, 2023
  5. Mario GrgicMar 25, 2023
  6. demerphqMar 25, 2023
  7. René ScharfeMar 25, 2023
  8. Junio C HamanoMar 27, 2023
  9. René ScharfeMar 27, 2023
  10. Junio C HamanoMar 27, 2023
  11. Junio C HamanoMar 28, 2023
  12. René ScharfeMar 28, 2023
  13. Mario GrgicMar 25, 2023
  14. Mario GrgicMar 25, 2023
  15. Junio C HamanoMar 27, 2023
  16. Mario GrgicMar 27, 2023
  17. Junio C HamanoMar 27, 2023
  18. Mario GrgicMar 28, 2023

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.