2023-01-19 05:26:06 +00:00
|
|
|
#pragma once
|
2023-04-01 03:18:41 +00:00
|
|
|
///@file
|
2023-01-19 05:26:06 +00:00
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
2024-01-30 17:37:23 +00:00
|
|
|
|
|
|
|
static constexpr std::string_view nameRegexStr =
|
|
|
|
// This uses a negative lookahead: (?!\.\.?(-|$))
|
|
|
|
// - deny ".", "..", or those strings followed by '-'
|
|
|
|
// - when it's not those, start again at the start of the input and apply the next regex, which is [0-9a-zA-Z\+\-\._\?=]+
|
|
|
|
R"((?!\.\.?(-|$))[0-9a-zA-Z\+\-\._\?=]+)";
|
2023-01-19 05:26:06 +00:00
|
|
|
|
|
|
|
}
|