Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: TGenerex ThenExpect(Func<TGenerexMatch, Exception>, IEqualityComparer<T>, params T[])

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

Declaration

public TGenerex ThenExpect(
    Func<TGenerexMatch, Exception> exceptionGenerator,
    IEqualityComparer<T> comparer,
    params T[] elements
)

Summary

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

Parameters

Func<TGenerexMatch, Exception>exceptionGenerator A selector which, in case of no match, generates the exception object to be thrown.
IEqualityComparer<T>comparer The equality comparer to use when matching elements.
T[]elements The sequence of elements that is expected to match after the current regular expression.

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>>).