Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex Syntax is inconsistent and under-documented #8768

Open
iFreilicht opened this issue Aug 1, 2023 · 1 comment
Open

Regex Syntax is inconsistent and under-documented #8768

iFreilicht opened this issue Aug 1, 2023 · 1 comment
Labels
documentation feature Feature request or proposal

Comments

@iFreilicht
Copy link
Contributor

iFreilicht commented Aug 1, 2023

Is your feature request related to a problem? Please describe.
This comment shows that there is no clear documentation on what regex dialect our commands use, and after digging into it, I myself am left confused.

C++ itself uses modified ECMAScript regex syntax by default, and that is what most (24, to be exact) of internal invocations seem to use, but there's 7 invocations that specifically set std::regex::extended, which are related to nix search, nix profile, nix-env and builtins.regex.

Only the documentation of builtins.regex mentions that it uses POSIX extended regex syntax.

Describe the solution you'd like

  • Somehow ensure that we use POSIX extended syntax in all CLI commands.
  • Document that all CLI commands are using POSIX extended syntax.

Describe alternatives you've considered
We could use ECMAScript syntax instead, which would be easier to keep consistent as it is the default and has some features that could be useful for package searching (like word boundaries), but this could be a breaking change.

Additional context
None.

Priorities

Add 👍 to issues you find important.

@sullyj3
Copy link

sullyj3 commented Aug 1, 2023

see also #3047, #1537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

3 participants