Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: TOtherGenerex ThenExpect<TOtherGenerex, TOtherMatch, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>>, Func<TGenerexMatch, Exception>)

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

Declaration

public TOtherGenerex ThenExpect<TOtherGenerex, TOtherMatch, TOtherGenerexMatch>(
    Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>> selector,
    Func<TGenerexMatch, Exception> exceptionGenerator
)

Summary

Returns a regular expression that matches this regular expression, uses a specified selector to create a new regular expression from the match, attempts to match the new regular expression and throws an exception if the new regular expression fails to match.

Generic type parameters

TOtherGenerex
  • Must derive from: RT.Generexes.GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>.
Type of the regular expression generated by the selector.
TOtherMatch Type of internal match information used by TOtherGenerex (i.e. int or LengthAndResult<T>).
TOtherGenerexMatch Type of match object returned by matches of TOtherGenerex.

Parameters

Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>>selector A delegate that creates a new regular expression from a match of the current regular expression.
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>>).