Skip to content

Commit

Permalink
fix backslash match
Browse files Browse the repository at this point in the history
  • Loading branch information
yangon99 committed Feb 12, 2023
1 parent 86fe42e commit 8c913e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ string join2str(const int argc, char **argv, const char delm) {
bool startWith(string s, string prefix) { return s.rfind(prefix, 0) == 0; }

bool validCgroup(const string cgroup) {
return regex_match(cgroup, regex("^/[a-zA-Z0-9\\-_./@]*$"));
return regex_match(cgroup, regex("^/[a-zA-Z0-9-\\\\_./@]*$"));
}

bool validCgroup(const vector<string> cgroup) {
for (auto &e : cgroup) {
if (!regex_match(e, regex("^/[a-zA-Z0-9\\-_./@]*$"))) { return false; }
if (!regex_match(e, regex("^/[a-zA-Z0-9-\\\\_./@]*$"))) { return false; }
}
return true;
}
Expand Down

0 comments on commit 8c913e9

Please sign in to comment.