OP2_GT,
OP2_GE,
OP2_RE_MATCH,
+ OP2_RE_UNMATCH,
};
struct token {
static bool op2_gt (struct node *, struct node *, struct parameter*, struct libscols_line *);
static bool op2_ge (struct node *, struct node *, struct parameter*, struct libscols_line *);
static bool op2_re_match (struct node *, struct node *, struct parameter*, struct libscols_line *);
+static bool op2_re_unmatch (struct node *, struct node *, struct parameter*, struct libscols_line *);
static bool op2_check_type_eq_or_bool_or_op(struct parser *, struct op2_class *, struct node *, struct node *);
static bool op2_check_type_boolean_or_op (struct parser *, struct op2_class *, struct node *, struct node *);
.is_acceptable = op2_re_match,
.check_type = op2_check_type_re,
},
+ [OP2_RE_UNMATCH] = {
+ .name = "!~",
+ .is_acceptable = op2_re_unmatch,
+ .check_type = op2_check_type_re,
+ },
};
#define NODE_CLASS(NODE) (&node_classes[(NODE)->type])
t->type = TOKEN_OP2;
t->val.op2 = OP2_NE;
break;
+ } else if (c0 == '~') {
+ t->type = TOKEN_OP2;
+ t->val.op2 = OP2_RE_UNMATCH;
+ break;
}
parser_ungetc(parser, c0);
t->type = TOKEN_OP1;
return (regexec(&VAL(right,re), str, 0, NULL, 0) == 0);
}
+static bool op2_re_unmatch(struct node *left, struct node *right,
+ struct parameter *params, struct libscols_line *ln)
+{
+ return !op2_re_match(left, right, params, ln);
+}
+
static bool op2_check_type_boolean_or_op(struct parser* parser, struct op2_class *op2_class,
struct node *left, struct node *right)
{