Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Generexes.Generex

Summary

Provides static factory methods to generate Generex<T> and Generex<T, TResult> objects.

Static methods

Generex<T>
CreateAnyGenerex<T>(this T[] input)
Returns a regular expression that matches a single element, no matter what it is (cf. . in traditional regular expression syntax).
Generex<T>
CreateAnythingGenerex<T>(this T[] input)
Returns a regular expression that matches any number of elements, no matter what they are; fewer are prioritized (cf. .*? in traditional regular expression syntax).
Generex<T>
CreateAnythingGreedyGenerex<T>(this T[] input)
Returns a regular expression that matches any number of elements, no matter what they are; more are prioritized (cf. .* in traditional regular expression syntax).
Generex<T>
CreateEmptyGenerex<T>(this T[] input)
Returns a regular expression that always matches and returns a zero-width match.
Generex<T>
CreateEndGenerex<T>(this T[] input)
Returns a regular expression that matches the end of the input collection (cf. $ in traditional regular expression syntax). Successful matches are always zero length.
Generex<T>
CreateFailGenerex<T>(this T[] input)
Returns a regular expression that never matches (cf. (?!) in traditional regular expression syntax).
Generex<T>
CreateGenerex<T>(this T[] input, Predicate<T> predicate)
Instantiates a regular expression that matches a single element that satisfies the given predicate (cf. [...] in traditional regular expression syntax).
Generex<T>
CreateRecursiveGenerex<T>(this T[] input, Func<Generex<T>, Generex<T>> generator)
Generates a recursive regular expression, i.e. one that can contain itself, allowing the matching of arbitrarily nested expressions.
Generex<T, TResult>
CreateRecursiveGenerex<T, TResult>(this T[] input, TResult example, Func<Generex<T, TResult>, Generex<T, TResult>> generator)
Generex<T>
CreateStartGenerex<T>(this T[] input)
Returns a regular expression that matches the beginning of the input collection (cf. ^ in traditional regular expression syntax). Successful matches are always zero length.
Generex<T>
InAnyOrder<T>(params T[] elements)
Generates a regular expression that matches the specified elements in any order.
Generex<T>
InAnyOrder<T>(params Generex<T>[] generexes)
Generates a regular expression that matches the specified regular expressions in any order.
Generex<T>
InAnyOrder<T>(IEqualityComparer<T> comparer, params T[] elements)
Generates a regular expression that matches the specified elements in any order.
Generex<T, IEnumerable<TResult>>
InAnyOrder<T, TResult>(params Generex<T, TResult>[] generexes)
Generates a regular expression that matches the specified regular expressions in any order.
Generex<T, IEnumerable<TResult>>
InAnyOrder<T, TResult>(IEnumerable<Generex<T, TResult>> generexes)
bool
IsMatch<T, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, int mustStartAt = 0)
Determines whether the given input sequence matches this regular expression at a specific index.
bool
IsMatchExact<T, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, int mustStartAt = 0, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression exactly.
bool
IsMatchReverse<T, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, int? mustEndAt = null)
Determines whether the given input sequence matches this regular expression up to a specific index.
TGenerexMatch
Match<T, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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, TMatch, TGenerex, TGenerexMatch>(this T[] input, GenerexBase<T, TMatch, TGenerex, TGenerexMatch> generex, 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).
Generex<T>
New<T>(params T[] elements)
Instantiates a regular expression that matches a sequence of consecutive elements.
Generex<T>
New<T>(Predicate<T> predicate)
Instantiates a regular expression that matches a single element that satisfies the given predicate (cf. [...] in traditional regular expression syntax).
Generex<T>
New<T>(params Generex<T>[] generexes)
Instantiates a regular expression that matches a sequence of consecutive regular expressions.
Generex<T>
New<T>(IEqualityComparer<T> comparer, params T[] elements)
Instantiates a regular expression that matches a sequence of consecutive elements using the specified equality comparer.
Generex<T>
Not<T>(params T[] elements)
Returns a regular expression that matches a single element which is none of the specified elements.
Generex<T>
Not<T>(IEqualityComparer<T> comparer, params T[] elements)
Stringerex<TResult>
OrDefault<TResult>(this Stringerex<TResult> inner)
Returns a regular expression that matches this regular expression zero times or once. Zero times is prioritised (cf. ?? in traditional regular expression syntax).
Generex<T, TResult>
OrDefault<T, TResult>(this Generex<T, TResult> inner)
Stringerex<TResult>
OrDefaultGreedy<TResult>(this Stringerex<TResult> inner)
Returns a regular expression that matches this regular expression zero times or once. Once is prioritised (cf. ? in traditional regular expression syntax).
Generex<T, TResult>
OrDefaultGreedy<T, TResult>(this Generex<T, TResult> inner)
Stringerex<TResult?>
OrNull<TResult>(this Stringerex<TResult> inner)
Returns a regular expression that matches this regular expression zero times or once. Zero times is prioritised (cf. ?? in traditional regular expression syntax).
Generex<T, TResult?>
OrNull<T, TResult>(this Generex<T, TResult> inner)
Stringerex<TResult?>
OrNullGreedy<TResult>(this Stringerex<TResult> inner)
Returns a regular expression that matches this regular expression zero times or once. Once is prioritised (cf. ? in traditional regular expression syntax).
Generex<T, TResult?>
OrNullGreedy<T, TResult>(this Generex<T, TResult> inner)
TGenerex
Ors<T, TMatch, TGenerex, TGenerexMatch>(IEnumerable<GenerexBase<T, TMatch, TGenerex, TGenerexMatch>> generexes)
Returns a regular expression that matches any of the specified regular expressions (cf. | in traditional regular expression syntax).
TGenerex
Ors<T, TMatch, TGenerex, TGenerexMatch>(params GenerexBase<T, TMatch, TGenerex, TGenerexMatch>[] generexes)
TResult?
RawMatchNullable<TResult>(this Stringerex<TResult> stringerex, string input, int startAt = 0)
Determines whether the given input string matches this regular expression, and if so, returns the result of the first match; otherwise, returns null.
TResult?
RawMatchNullable<T, TResult>(this Generex<T, TResult> generex, 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; otherwise, returns null.
TResult?
RawMatchReverseNullable<TResult>(this Stringerex<TResult> stringerex, string input, int? endAt = null)
Determines whether the given input string matches this regular expression, and if so, returns the result of the first match found by matching the regular expression backwards; otherwise, returns null.
TResult?
RawMatchReverseNullable<T, TResult>(this Generex<T, TResult> generex, 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; otherwise, returns null.
Generex<T>
Recursive<T>(Func<Generex<T>, Generex<T>> generator)
Generates a recursive regular expression, i.e. one that can contain itself, allowing the matching of arbitrarily nested expressions.
Generex<T, TResult>
Recursive<T, TResult>(Func<Generex<T, TResult>, Generex<T, TResult>> generator)
Stringerex
ToStringerex(this Generex<char> generex)
Converts the specified Generex<T> to an equivalent regular expression of type Stringerex.
Stringerex<TResult>
ToStringerex<TResult>(this Generex<char, TResult> generex)
Converts the specified Generex<T, TResult> to an equivalent regular expression of type Stringerex<TResult>.