Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: TGenerex ThenExpect<TOtherGenerex, TOtherGenerexMatch>(IEnumerable<GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>>, Func<TGenerexMatch, Exception>)

  • Declared in: RT.Generexes.GenerexBase<T, TMatch, TGenerex, TGenerexMatch>

Declaration

public TGenerex ThenExpect<TOtherGenerex, TOtherGenerexMatch>(
    IEnumerable<GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> expectation,
    Func<TGenerexMatch, Exception> exceptionGenerator
)

Summary

Returns a regular expression that matches this regular expression, then attempts to match the specified sequence of other regular expressions and throws an exception if the sequence fails to match.

Generic type parameters

TOtherGenerex The type of regular expressions in the expectation sequence. (This is either Generex<T> or Stringerex.)
TOtherGenerexMatch The type of the match object of the regular expressions in the expectation. (This is either GenerexMatch<T> or StringerexMatch.)

Parameters

IEnumerable<GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>>expectation The sequence of regular expressions that are expected to match after the current one.
Func<TGenerexMatch, Exception>exceptionGenerator A selector which, in case of no match, generates the exception object to be thrown.

Returns

The resulting regular expression.

Remarks

Regular expressions created by this method cannot match backwards. The full set of affected methods is listed at GenerexBase<T, TMatch, TGenerex, TGenerexMatch>.Then<TOtherGenerex, TOtherMatch, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>>).