Skip to content

Commit 04e8fd7

Browse files
authored
Fix wrong use of ? quantifier in regex (#1102)
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.
1 parent 185d375 commit 04e8fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/tutorials/module-system/deep-dive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ Add a new `colorType` block to `path.nix`, specifying the allowed color names an
11491149
11501150
+ # Either a color name, `0xRRGGBB` or `0xRRGGBBAA`
11511151
+ colorType = lib.types.either
1152-
+ (lib.types.strMatching "0x[0-9A-F]{6}[0-9A-F]{2}?")
1152+
+ (lib.types.strMatching "0x[0-9A-F]{6}([0-9A-F]{2})?")
11531153
+ (lib.types.enum [
11541154
+ "black" "brown" "green" "purple" "yellow"
11551155
+ "blue" "gray" "orange" "red" "white"

0 commit comments

Comments
 (0)