csv-schema
csv-schema copied to clipboard
A proper logical NOT operator
AFAIK Currently, the only way to express a negative rule is via the @matchIsFalse directive.
This means the entire column rule must be expressed either as a positive or a negative condition, and mixing positive and negative conditions (e.g. regex("[A-Z]+") and not(starts($another_column))
) is not possible.
It would, therefore, be quite nice if a logical NOT
operation was available that could invert the logic of arbitrary column validation expressions.
By De Morgan's laws you could equivalently express that as
regex("[^A-Z]+") or starts($another_column) @matchIsFalse
though I agree that the representation with not is preferable (and this work around wouldn't apply in all cases, it only works for this example due to the availability of the negation operator in regex), so I'll label this as an enhancement request.