3
0
Fork 0
forked from mirrors/nixpkgs

lib.sanitizeDerivationName: Simplify regex

`^` and `$` are implicit in `match`.
This commit is contained in:
Robert Hensing 2022-04-05 19:14:09 +02:00
parent 2999ab114e
commit fffabe7500

View file

@ -757,7 +757,7 @@ rec {
=> "-nix-store-2g75chlbpxlrqn15zlby2dfh8hr9qwbk-hello-2.10"
*/
sanitizeDerivationName =
let okRegex = match "^[[:alnum:]+_?=-][[:alnum:]+._?=-]*$";
let okRegex = match "[[:alnum:]+_?=-][[:alnum:]+._?=-]*";
in
string:
# First detect the common case of already valid strings, to speed those up