Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A proper logical NOT operator #32

Open
crizzis opened this issue Jun 30, 2020 · 1 comment
Open

A proper logical NOT operator #32

crizzis opened this issue Jun 30, 2020 · 1 comment

Comments

@crizzis
Copy link

crizzis commented Jun 30, 2020

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.

@DavidUnderdown
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants