1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 23:28:26 -04:00
nix/src/libutil/regex.hh
Eelco Dolstra 104e55bb7f nix-env: Add regular expression support in selectors
So you can now do things like:

  $ nix-env -qa '.*zip.*'
  $ nix-env -qa '.*(firefox|chromium).*'
2014-10-03 21:29:40 +02:00

23 lines
267 B
C++

#pragma once
#include "types.hh"
#include <sys/types.h>
#include <regex.h>
namespace nix {
class Regex
{
public:
Regex(const string & pattern);
~Regex();
bool matches(const string & s);
private:
regex_t preg;
string showError(int err);
};
}