String: Implement String != regex operator
[libacl.git] / src / regex.cpp
index 3f7a675..397f3c0 100644 (file)
@@ -96,11 +96,22 @@ bool operator == (const String &s, const regex &r)
 {
    return regexec(&r.expression, s.p->s, 0, 0, 0) == 0;
 }
+
 bool operator == (const regex &r, const String &s)
 {
    return regexec(&r.expression, s.p->s, 0, 0, 0) == 0;
 }
 
+bool operator != (const String &s, const regex &r)
+{
+   return regexec(&r.expression, s.p->s, 0, 0, 0) != 0;
+}
+
+bool operator != (const regex &r, const String &s)
+{
+   return regexec(&r.expression, s.p->s, 0, 0, 0) != 0;
+}
+
 substring String::operator()(const regex &r)
 {
    substring sub;