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

Fix wrong use of ? quantifier in regex #1102

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

dwt
Copy link
Contributor

@dwt dwt commented Jan 31, 2025

The Regex format is wrong, it wants to say that the last two components (AA) are optional, but that needs a n optional group. At least for me on lix - but this also rhymes with my understanding of regexes.

❯ nix --version
nix (Lix, like Nix) 2.92.0
System type: aarch64-darwin
Additional system types: aarch64-darwin, x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/dwt/.config/nix/nix.conf:/Users/dwt/.nix-profile/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/jgg7r6y6zz7lj84n1x4l8g8n25n3mpky-lix-2.92.0/share

The Regex format is wrong, it wants to say that the last two components (AA) are optional, but that needs a n optional group. At least for me on lix - but this also rhymes with my understanding of regexes.

```bash
❯ nix --version
nix (Lix, like Nix) 2.92.0
System type: aarch64-darwin
Additional system types: aarch64-darwin, x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/dwt/.config/nix/nix.conf:/Users/dwt/.nix-profile/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/jgg7r6y6zz7lj84n1x4l8g8n25n3mpky-lix-2.92.0/share
```
Copy link
Collaborator

@fricklerhandwerk fricklerhandwerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, great catch! Thank you very much.

@fricklerhandwerk fricklerhandwerk merged commit 04e8fd7 into NixOS:master Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants