Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Abstract class: RT.Generexes.GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch>

Summary

Abstract base class for Generex<T, TResult> and Stringerex<TResult>.

Generic type parameters

T Type of the objects in the collection.
TResult Type of the result object associated with each match of the regular expression.
TGenerex The derived type. (Pass the type itself recursively.)
TGenerexMatch Type describing a match of a regular expression.

Constructors

Instantiates an empty regular expression which always matches and returns the specified result object.

Instance methods

TGenerex
And<TOtherGenerex, TOtherGenerexMatch>(GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch> other)
Returns a regular expression that only matches if the subarray matched by this regular expression also contains a match for the specified other regular expression. (see also remarks)
TGenerex
AndExact<TOtherGenerex, TOtherGenerexMatch>(GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch> other)
Returns a regular expression that only matches if the subarray matched by this regular expression also fully matches the specified other regular expression. (see also remarks)
TGenerex Matches this regular expression atomically (without backtracking into it) (cf. (?>...) in traditional regular expression syntax).
TGenerex
Do(Action<TGenerexMatch> code)
Executes the specified code every time the regular expression engine encounters this expression.
TGenerex
DoRaw(Action<TResult> code)
bool
IsMatch(T[] input, int startAt = 0)
Determines whether the given input sequence contains a match for this regular expression, optionally starting the search at a specified index.
bool
IsMatchAt(T[] input, int mustStartAt = 0)
Determines whether the given input sequence matches this regular expression at a specific index.
bool
IsMatchExact(T[] input, int mustStartAt = 0, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression exactly.
bool
IsMatchReverse(T[] input, int? endAt = null)
Determines whether the given input sequence contains a match for this regular expression that ends before the specified maximum index.
bool
IsMatchUpTo(T[] input, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression up to a specific index.
TGenerex Turns the current regular expression into a zero-width positive look-ahead assertion (cf. (?=...) in traditional regular expression syntax).
TGenerex
LookAheadNegative(TResult defaultMatch)
Turns the current regular expression into a zero-width negative look-ahead assertion (cf. (?!...) in traditional regular expression syntax), which returns the specified default result in case of a match.
TGenerex Turns the current regular expression into a zero-width positive look-behind assertion (cf. (?<=...) in traditional regular expression syntax).
TGenerex
LookBehindNegative(TResult defaultMatch)
Turns the current regular expression into a zero-width negative look-behind assertion (cf. (?<!...) in traditional regular expression syntax), which returns the specified default result in case of a match.
TGenerexMatch
Match(T[] input, int startAt = 0)
Determines whether the given input sequence matches this regular expression, and if so, returns information about the first match.
IEnumerable<TGenerexMatch>
Matches(T[] input, int startAt = 0)
Returns a sequence of non-overlapping regular expression matches, optionally starting the search at the specified index. (see also remarks)
IEnumerable<TGenerexMatch>
MatchesReverse(T[] input, int? endAt = null)
Returns a sequence of non-overlapping regular expression matches going backwards (starting at the end of the specified input sequence), optionally starting the search at the specified index.
TGenerexMatch
MatchExact(T[] input, int mustStartAt = 0, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression exactly, and if so, returns information about the match.
TGenerexMatch
MatchReverse(T[] input, int? endAt = null)
Determines whether the given input sequence matches this regular expression, and if so, returns information about the first match found by matching the regular expression backwards (starting from the end of the input sequence).
TGenerex
Or<TOtherGenerex, TOtherGenerexMatch>(GenerexBase<T, LengthAndResult<TResult>, TOtherGenerex, TOtherGenerexMatch> other)
Returns a regular expression that matches either this regular expression or the specified other regular expression (cf. | in traditional regular expression syntax).
TResult
RawMatch(T[] input, int startAt = 0)
Determines whether the given input sequence matches this regular expression, and if so, returns the result of the first match.
IEnumerable<TResult>
RawMatches(T[] input, int startAt = 0)
Returns a sequence of non-overlapping regular expression matches, optionally starting the search at the specified index. (see also remarks)
IEnumerable<TResult>
RawMatchesReverse(T[] input, int? endAt = null)
Returns a sequence of non-overlapping regular expression matches going backwards, optionally starting the search at the specified index.
TResult
RawMatchExact(T[] input, int mustStartAt = 0, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression exactly, and if so, returns the match.
TResult
RawMatchReverse(T[] input, int? endAt = null)
Determines whether the given input sequence matches this regular expression, and if so, returns the result of the first match found by matching the regular expression backwards.
T[]
Replace(T[] input, Func<TGenerexMatch, IEnumerable<T>> replaceWith, int startAt = 0, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence with the replacement sequence returned by the given selector.
T[]
Replace(T[] input, IEnumerable<T> replaceWith, int startAt = 0, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence with a replacement sequence. (see also remarks)
T[]
ReplaceRaw(T[] input, Func<TResult, IEnumerable<T>> replaceWithRaw, int startAt = 0, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence with the replacement sequence returned by the given selector.
T[]
ReplaceReverse(T[] input, Func<TGenerexMatch, IEnumerable<T>> replaceWith, int? endAt = null, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence, matched from the end backwards, with the replacement sequence returned by the given selector.
T[]
ReplaceReverse(T[] input, IEnumerable<T> replaceWith, int? endAt = null, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence, matched from the end backwards, with a replacement sequence.
T[]
ReplaceReverseRaw(T[] input, Func<TResult, IEnumerable<T>> replaceWithRaw, int? endAt = null, int? maxReplace = null)
Replaces each match of this regular expression within the given input sequence, matched from the end backwards, with the replacement sequence returned by the given selector.
TGenerex
Then(params T[] elements)
Returns a regular expression that matches this regular expression followed by the specified sequence of elements.
TGenerex
Then(IEnumerable<T> elements)
TGenerex
Then(Predicate<T> predicate)
Returns a regular expression that matches this regular expression followed by a single element that satisfies the specified predicate.
TGenerex
Then(IEqualityComparer<T> comparer, params T[] elements)
Returns a regular expression that matches this regular expression followed by the specified sequence of elements, using the specified equality comparer.
TGenerex
Then(IEqualityComparer<T> comparer, IEnumerable<T> elements)
TGenerex
Then<TOtherGenerex, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> selector)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the match, then matches the new regular expression and retains the result object from the first match. (see also remarks)
TGenerex
Then<TOtherGenerex, TOtherGenerexMatch>(params GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>[] other)
Returns a regular expression that matches a consecutive sequence of regular expressions, beginning with this one, followed by the specified ones.
TGenerex
Then<TOtherGenerex, TOtherGenerexMatch>(IEnumerable<GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> other)
TOtherGenerex
Then<TOtherGenerex, TOtherMatch, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>> selector)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the match, and then matches the new regular expression. (see also remarks)
TGenerex
ThenExpect(Func<TGenerexMatch, Exception> exceptionGenerator, params T[] elements)
Returns a regular expression that matches this regular expression, then attempts to match the specified sequence of elements and throws an exception if that sequence fails to match. (see also remarks)
TGenerex
ThenExpect(Func<TGenerexMatch, Exception> exceptionGenerator, IEnumerable<T> elements)
TGenerex
ThenExpect(Predicate<T> predicate, Func<TGenerexMatch, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then attempts to match a single element that satisfies the specified predicate and throws an exception if that predicate fails to match. (see also remarks)
TGenerex
ThenExpect(T element, Func<TGenerexMatch, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then attempts to match a single element and throws an exception if that element fails to match. (see also remarks)
TGenerex
ThenExpect(Func<TGenerexMatch, Exception> exceptionGenerator, IEqualityComparer<T> comparer, params T[] elements)
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. (see also remarks)
TGenerex
ThenExpect(Func<TGenerexMatch, Exception> exceptionGenerator, IEqualityComparer<T> comparer, IEnumerable<T> elements)
TGenerex
ThenExpect<TOtherGenerex, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> selector, Func<TGenerexMatch, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the match; then attempts to match the new regular expression and throws an exception if that regular expression fails to match. This regular expression’s result object remains unaltered. (see also remarks)
TGenerex
ThenExpect<TOtherGenerex, TOtherGenerexMatch>(Func<TGenerexMatch, Exception> exceptionGenerator, params GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>[] expectation)
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. (see also remarks)
TGenerex
ThenExpect<TOtherGenerex, TOtherGenerexMatch>(IEnumerable<GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> expectation, Func<TGenerexMatch, Exception> exceptionGenerator)
TGenerex
ThenExpect<TOtherGenerex, TOtherGenerexMatch>(GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch> expectation, Func<TGenerexMatch, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then attempts to match the specified other regular expression and throws an exception if the sequence fails to match. (see also remarks)
TOtherGenerex
ThenExpect<TOtherGenerex, TOtherMatch, TOtherGenerexMatch>(Func<TGenerexMatch, GenerexBase<T, TOtherMatch, TOtherGenerex, TOtherGenerexMatch>> selector, Func<TGenerexMatch, Exception> exceptionGenerator)
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. (see also remarks)
TGenerex
ThenExpectRaw<TOtherGenerex, TOtherGenerexMatch>(Func<TResult, GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> selector, Func<TResult, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the result object; then attempts to match the new regular expression and throws an exception if that regular expression fails to match. This regular expression’s result object remains unaltered. (see also remarks)
TOtherGenerex
ThenExpectRaw<TOtherGenerex, TOtherResult, TOtherGenerexMatch>(Func<TResult, GenerexWithResultBase<T, TOtherResult, TOtherGenerex, TOtherGenerexMatch>> selector, Func<TResult, Exception> exceptionGenerator)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the result object; then attempts to match the new regular expression and throws an exception if that regular expression fails to match. The new regular expression’s result object replaces the current one’s. (see also remarks)
TGenerex
ThenRaw<TOtherGenerex, TOtherGenerexMatch>(Func<TResult, GenerexNoResultBase<T, TOtherGenerex, TOtherGenerexMatch>> selector)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the result of the match, and then matches the new regular expression. This regular expression’s result object remains unaltered. (see also remarks)
TOtherGenerex
ThenRaw<TOtherGenerex, TOtherResult, TOtherGenerexMatch>(Func<TResult, GenerexWithResultBase<T, TOtherResult, TOtherGenerex, TOtherGenerexMatch>> selector)
Returns a regular expression that matches this regular expression, then uses a specified selector to create a new regular expression from the result of the match, and then matches the new regular expression. This regular expression’s result object is replaced with the new one’s. (see also remarks)
TGenerex
Throw(Func<TGenerexMatch, Exception> exceptionGenerator)
Throws an exception generated by the specified code when the regular expression engine encounters this expression.
TGenerex
Where(Func<TGenerexMatch, bool> code)
Restricts matches of this regular expression to those that satisfy the specified predicate.
TGenerex
WhereRaw(Func<TResult, bool> code)

Static methods

TGenerex
Ors(params TGenerex[] other)
Returns a regular expression that matches any of the specified regular expressions (cf. | in traditional regular expression syntax).
TGenerex
Ors(IEnumerable<TGenerex> other)
TGenerex
Recursive(Func<TGenerex, TGenerex> generator)
Generates a recursive regular expression, i.e. one that can contain itself, allowing the matching of arbitrarily nested expressions.

Operators

TGenerex
operator+(GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch> one, T two)
Returns a regular expression that matches the specified regular expression (first operand) followed by the specified element (second operand).
TGenerex
operator+(T one, GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch> two)
Returns a regular expression that matches the specified element (first operand) followed by the specified regular expression (second operand).
TGenerex
operator+(GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch> one, Predicate<T> two)
Returns a regular expression that matches the specified regular expression (first operand) followed by a single element that satisfies the specified predicate (second operand).
TGenerex
operator+(Predicate<T> one, GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch> two)
Returns a regular expression that matches a single element that satisfies the specified predicate (first operand) followed by the specified regular expression (second operand).
TGenerex
operator|(GenerexWithResultBase<T, TResult, TGenerex, TGenerexMatch> one, TGenerex two)
Returns a regular expression that matches either one of the specified regular expressions (cf. | in traditional regular expression syntax).

Static properties

TGenerex Returns a regular expression that never matches (cf. (?!) in traditional regular expression syntax).