Otter SDK Reference
Version:

LazyRegex Class

Represents a lazily-initialized immutable regular expression.

Inheritance Hierarchy

  • object
    • System.Lazy<System.Text.RegularExpressions.Regex>
      • Inedo.LazyRegex

Syntax

public class LazyRegex : Lazy<System.Text.RegularExpressions.Regex>

Constructors

Name Description
LazyRegex(string pattern)

Initializes a new instance of the LazyRegex class.

LazyRegex(string pattern, System.Text.RegularExpressions.RegexOptions options)

Initializes a new instance of the LazyRegex class.

Methods

Name Description
IsMatch(string input)

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

IsMatch(string input, int startat)

Indicates whether the regular expression specified in the LazyRegex constructor finds a match in the specified input string, beginning at the specified starting position in the string.

Match(string input)

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

Match(string input, int startat)

Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position in the string.

Match(string input, int beginning, int length)

Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position and searching only the specified number of characters.

Matches(string input)

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

Matches(string input, int startat)

Searches the specified input string for all occurrences of a regular expression, beginning at the specified starting position in the string.

Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator)

Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a System.Text.RegularExpressions.MatchEvaluator delegate.

Replace(string input, string replacement)

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

Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count)

Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a System.Text.RegularExpressions.MatchEvaluator delegate.

Replace(string input, string replacement, int count)

Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string.

Replace(string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count, int startat)

Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a System.Text.RegularExpressions.MatchEvaluator delegate.

Replace(string input, string replacement, int count, int startat)

Within a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string.

Split(string input)

Splits the specified input string at the positions defined by a regular expression pattern specified in the LazyRegex constructor.

Split(string input, int count)

Splits the specified input string a specified maximum number of times at the positions defined by a regular expression specified in the LazyRegex constructor.

Split(string input, int count, int startat)

Splits the specified input string a specified maximum number of times at the positions defined by a regular expression specified in the LazyRegex constructor. The search for the regular expression pattern starts at a specified character position in the input string.

Remarks

This is just a convenience wrapper for System.Lazy`1 to allow regular expressions to be compiled on first use instead of as part of a static type initializer or something similar.