verily icon indicating copy to clipboard operation
verily copied to clipboard

[:not [___ ...]]

Open devn opened this issue 6 years ago • 2 comments

I recently ran into a situation where I wanted to disallow a specific character in a field. In this case, I reached for matches and provided a whitelist regex. It would be nice to be able to do something like [:not [:matches ...]]. Perhaps I should have reached for in?

devn avatar Jun 07 '19 20:06 devn

Hi @devn

Is this a feature request? It has been long time I looked at the internals of this library so some snippet describing your expected behavior would help a lot. :smile:

iku000888 avatar Jun 07 '19 20:06 iku000888

Maybe! It may also be a misunderstanding on my part.

Pretend I have a map {:field "VAL-UE"}, which I do not want to be valid, because it contains a -.

I resorted to [[:matches #"^[A-Za-z]*$" :field "Only alpha chars allowed"]], but I was looking for something more like [[:does-not-contain #"-" :field "Dashes not allowed."]]. I imagined it might be nice to be able to do things like [:not [:matches ...] "msg"] [:not [:equal ...] "msg"] and so on. Perhaps I've overlooked something though. Feedback welcome!

devn avatar Jun 07 '19 23:06 devn