mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
lib.sanitizeDerivationName: Simplify regex
`^` and `$` are implicit in `match`.
This commit is contained in:
parent
2999ab114e
commit
fffabe7500
@ -757,7 +757,7 @@ rec {
|
|||||||
=> "-nix-store-2g75chlbpxlrqn15zlby2dfh8hr9qwbk-hello-2.10"
|
=> "-nix-store-2g75chlbpxlrqn15zlby2dfh8hr9qwbk-hello-2.10"
|
||||||
*/
|
*/
|
||||||
sanitizeDerivationName =
|
sanitizeDerivationName =
|
||||||
let okRegex = match "^[[:alnum:]+_?=-][[:alnum:]+._?=-]*$";
|
let okRegex = match "[[:alnum:]+_?=-][[:alnum:]+._?=-]*";
|
||||||
in
|
in
|
||||||
string:
|
string:
|
||||||
# First detect the common case of already valid strings, to speed those up
|
# First detect the common case of already valid strings, to speed those up
|
||||||
|
Loading…
Reference in New Issue
Block a user