zeroOrMore() and oneOrMore() do not generat correct results
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start by locating zeroOrMore(), oneOrMore(), and maybe() in the Java source, then compare how each method builds its regex fragment. Reproduce the examples from the issue and inspect existing tests, if present. Done means repetition applies to the complete added expression and the generated regex matches the expected grouped form for both methods.
Written by the indexing model from the issue text.
Description
The expression:
regex().add("Java").zeroOrMore().build();
should generate the regex: /(?:Java)*/, just as the expression:
regex().maybe("Java").build();
generates the regex: /(?:Java)?/. However, the first expression actually generates the regex: /Java*/, which is not correct. The oneOrMore() method suffers from the similar problem.
I propose to change both zeroOrMore() and oneOrMore() to accept a string, much as the maybe() method does so it can return the correct result.
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 243
- Avg merge
- 26m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VerbalExpressions/JavaVerbalExpressions
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
VerbalExpressions/JavaVerbalExpressions#76 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
VerbalExpressions/JavaVerbalExpressions#73 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
VerbalExpressions/JavaVerbalExpressions#66 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
VerbalExpressions/JavaVerbalExpressions#63 · 1 comment ·
-
or for no string Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
All issues in VerbalExpressions/JavaVerbalExpressions
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100