C# Class Patterns.Text.RegularExpressions.RegexEvaluator

Defines a default implementation of the IRegexEvaluator interface.
Inheritance: IRegexEvaluator
Show file Open project: patterns-group/code-patterns

Public Methods

Method Description
IsMatch ( string input, CompiledRegex pattern ) : bool

Indicates whether the regular expression finds a match in the input string.

Match ( string input, CompiledRegex pattern ) : Match

Searches the specified input string for the first occurrence of the specified regular expression.

Matches ( string input, CompiledRegex pattern ) : MatchCollection

Searches the specified input string for all occurrences of a specified regular expression.

Replace ( string input, CompiledRegex pattern, string replacement ) : string

In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string.

Split ( string input, CompiledRegex pattern ) : string[]

Splits an input string into an array of substrings at the positions defined by a regular expression pattern.

Method Details

IsMatch() public method

Indicates whether the regular expression finds a match in the input string.
public IsMatch ( string input, CompiledRegex pattern ) : bool
input string The string to search for a match.
pattern CompiledRegex The regular expression pattern to match.
return bool

Match() public method

Searches the specified input string for the first occurrence of the specified regular expression.
public Match ( string input, CompiledRegex pattern ) : Match
input string The string to search for a match.
pattern CompiledRegex The regular expression pattern to match.
return System.Text.RegularExpressions.Match

Matches() public method

Searches the specified input string for all occurrences of a specified regular expression.
public Matches ( string input, CompiledRegex pattern ) : MatchCollection
input string The string to search for a match.
pattern CompiledRegex The regular expression pattern to match.
return System.Text.RegularExpressions.MatchCollection

Replace() public method

In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string.
public Replace ( string input, CompiledRegex pattern, string replacement ) : string
input string The string to search for a match.
pattern CompiledRegex The regular expression pattern to match.
replacement string The replacement string.
return string

Split() public method

Splits an input string into an array of substrings at the positions defined by a regular expression pattern.
public Split ( string input, CompiledRegex pattern ) : string[]
input string The string to search for a match.
pattern CompiledRegex The regular expression pattern to match.
return string[]