Specification.

Match<T>(Expression<Func<T, string>>, string, RegexOptions) Method

Summary

Creates MatchSpecification for candidate property:

Checks if string candidate property match a given Regex pattern.

Namespace
FluentSpecification
Containing Type
Specification

Syntax

[PublicAPI]
[NotNull]
public static IComplexSpecification<T> Match<T>(Expression<Func<T, string>> selector, string pattern, RegexOptions options = null)

Attributes

Type Description
PublicAPI
NotNull

Type Parameters

Name Description
T Type of candidate.

Parameters

Name Type Description
selector Expression<Func<T, string>> Candidate property selector.
pattern string Regex pattern.
options RegexOptions Regex matching options.

Return Value

Type Description
IComplexSpecification<T> New complex Specification.

Exceptions

Type Description
System.ArgumentNullException Thrown when selector is null.
System.ArgumentException Thrown when selector is not valid.
System.ArgumentException Thrown when pattern is null or empty.
GitHub