Legend
| Method: TGenerex |
TOtherGenerex
| The type of the other regular expression. (This is either Generex<T, TResult> or Stringerex<TResult>.) |
TOtherGenerexMatch
| The type of the match object for the other regular expression. (This is either GenerexMatch<T, TResult> or StringerexMatch<TResult>.) |
GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch> | other | A regular expression which must match the subarray matched by this regular expression. |
It is important to note that a.And(b)
is not the same as b.And(a)
. Consider the following
input string:
foo {bar [baz]} quux
and the following regular expressions:
var curly = Stringerex.New('{').Then(Stringerex.Anything).Then('}'); var square = Stringerex.New('[').Then(Stringerex.Anything).Then(']');
Now consider:
curly.And(square)
means: match the curly brackets first (yielding the substring {bar
[baz]}
) and then match the square brackets inside of that. The result is a successful match,
because the substring {bar [baz]}
does contain [baz]
.square.And(curly)
means: match the square brackets first (yielding the substring [baz]
)
and then match the curly brackets inside of that. The result is no match, because there are no curly
brackets in [baz]
.