mirror of
https://github.com/NixOS/nix
synced 2025-06-28 09:31:16 +02:00
replace own regex class with std::regex
This commit is contained in:
parent
ae8884b949
commit
b05b98df75
5 changed files with 14 additions and 94 deletions
|
@ -33,8 +33,8 @@ DrvName::DrvName(const string & s) : hits(0)
|
|||
bool DrvName::matches(DrvName & n)
|
||||
{
|
||||
if (name != "*") {
|
||||
if (!regex) regex = std::shared_ptr<Regex>(new Regex(name));
|
||||
if (!regex->matches(n.name)) return false;
|
||||
if (!regex) regex = std::unique_ptr<std::regex>(new std::regex(name, std::regex::extended));
|
||||
if (!std::regex_match(n.name, *regex)) return false;
|
||||
}
|
||||
if (version != "" && version != n.version) return false;
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue