Skip to content

Commit

Permalink
Fix wrong use of ? quantifier in regex (#1102)
Browse files Browse the repository at this point in the history
The Regex format is wrong, it wants to say that the last two components (AA) are optional, but that needs an optional group. At least for me on lix - but this also rhymes with my understanding of regexes.
  • Loading branch information
dwt authored Jan 31, 2025
1 parent 185d375 commit 04e8fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/tutorials/module-system/deep-dive.md
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ Add a new `colorType` block to `path.nix`, specifying the allowed color names an
+ # Either a color name, `0xRRGGBB` or `0xRRGGBBAA`
+ colorType = lib.types.either
+ (lib.types.strMatching "0x[0-9A-F]{6}[0-9A-F]{2}?")
+ (lib.types.strMatching "0x[0-9A-F]{6}([0-9A-F]{2})?")
+ (lib.types.enum [
+ "black" "brown" "green" "purple" "yellow"
+ "blue" "gray" "orange" "red" "white"
Expand Down

0 comments on commit 04e8fd7

Please sign in to comment.