Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
url-parts.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include <string>
5
#include <regex>
6
7
namespace
nix {
8
9
// URI stuff.
10
static
const
std::string pctEncoded =
"(?:%[0-9a-fA-F][0-9a-fA-F])"
;
11
static
const
std::string unreservedRegex =
"(?:[a-zA-Z0-9-._~])"
;
12
static
const
std::string subdelimsRegex =
"(?:[!$&'\"()*+,;=])"
;
13
static
const
std::string pcharRegex =
"(?:"
+ unreservedRegex +
"|"
+ pctEncoded +
"|"
+ subdelimsRegex +
"|[:@])"
;
14
static
const
std::string fragmentRegex =
"(?:"
+ pcharRegex +
"|[/? \"^])*"
;
15
19
static
const
std::string refRegexS =
"[a-zA-Z0-9@][a-zA-Z0-9_.\\/@+-]*"
;
20
extern
std::regex refRegex;
21
23
static
const
std::string revRegexS =
"[0-9a-fA-F]{40}"
;
24
extern
std::regex revRegex;
25
27
static
const
std::string refAndOrRevRegex =
"(?:("
+ revRegexS +
")|(?:("
+ refRegexS +
")(?:/("
+ revRegexS +
"))?))"
;
28
29
}
// namespace nix
libutil
include
nix
util
url-parts.hh
Generated by
1.18.0