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

Fixing zeroOrMore() and oneOrMore() methods #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tavio
Copy link
Contributor

@Tavio Tavio commented Feb 6, 2015

This is a fix for issue #36.

zeroOrMore() and oneOrMore() methods now accept a parameter just like the maybe method() in order to generate correct expressions.

As a temporary side effect, it is no longer possible to do things like regex().digit().zeroOrMore(). I intend to fix this in a future PR.

… the maybe method() in order to generate correct expressions
@dummy-lanwen-bot
Copy link

Can one of the admins verify this patch?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.89% when pulling 66598f1 on Tavio:fix_one_or_more_zero_or_more into 1253395 on VerbalExpressions:master.

@@ -57,22 +57,22 @@ public void complexPatternWithMultiplyCaptures() throws Exception {
String logLine = "3\t4\t1\thttp://localhost:20001\t1\t63528800\t0\t63528800\t1000000000\t0\t63528800\tSTR1";

VerbalExpression regex = regex()
.capt().digit().oneOrMore().endCapture().tab()
.capt().digit().oneOrMore().endCapture().tab()
.capt().add("\\d+").endCapture().tab()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's bad

@lanwen
Copy link
Contributor

lanwen commented Feb 6, 2015

I think implementing of current behaviour can be done in this pr

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

Successfully merging this pull request may close these issues.

None yet

4 participants