anyOf is not matched requirements
See original GitHub issueHow can JavaVerbalExpressions build a simple regex like this: [\d,]+
VerbalExpression.regex().anyOf("0123456789,").oneOrMore().build()
It 's too ugly! How about this one: [a-k\s\d,]+ ?
It would be nice to add a anyOf method that can used like this:
VerbalExpression.regex().anyOf(DigitCharSet, WordCharSet, SpaceCharSet ,";:,\\").oneOrMore().build()
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
oneOf, anyOf, allOf, not - Swagger
When using oneOf , the following request body is not valid because it matches both schemas and not just one:
Read more >anyOf and allOf get ignored in the presence of not · Issue #1668
const ajv = new (require("ajv").default)() ... validation should return false , because 3 does does not match {anyOf: ["const": 1]} (or ...
Read more >Best Match for Validation error with oneof or anyof
I am aware of this but is there a solution from validation side , where the validator can give the best match. Because...
Read more >Full Criteria Match - Without any "AnyOf" Search Criteria
When you specify search criteria, the system tries to fetch candidates matching all the criteria specified. All candidates displayed in the search results ......
Read more >Validation Rules — Cerberus is a lightweight and extensible ...
Here's an example that tests whether an integer is odd or not: ... or a mapping of field names and a sequence of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s some late, but I think with an indentation it can be better:
You are right, sometimes regex is better than ve, principally for those who know regex enough. But we have a lot of thing to improve our code, whatever we use.
In some cases it’s true! VE is mostly for those who don’t know how to type simple regex. Or where you should write something that should be human-readable (for example in tests).