question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

anyOf is not matched requirements

See original GitHub issue

How 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:open
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
eduardohmgcommented, Feb 4, 2019

It’s some late, but I think with an indentation it can be better:

.add("[")
.wordChar().space().digit()
.add("]")
.oneOrMore()

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.

0reactions
lanwencommented, May 24, 2017

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found