-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
When you have an AnythingBut followed by a Maybe assuming the value of Maybe isn't the value of AnythingBut then the Maybe should be ignored.
For instance the two following are semantically the same:
var verbEx = VerbalExpressions.DefaultExpression
.StartOfLine()
.Then( "http" )
.Maybe( "s" )
.Then( "://" )
.Maybe( "www." )
.AnythingBut( " " )
.EndOfLine();
var verbEx = VerbalExpressions.DefaultExpression
.StartOfLine()
.Then( "http" )
.Maybe( "s" )
.Then( "://" )
.Maybe( "www." )
.AnythingBut( " " )
.Maybe("/")
.EndOfLine();
Both of the above should output ^(http)(s)?(://)(www\.)?([^\ ]*)$ because the AnythingBut is greedy and will capture whatever is in the Maybe.
Metadata
Metadata
Assignees
Labels
No labels