Search Results for

    Show / Hide Table of Contents

    Class RegexTools

    Regular expression tools

    Inheritance
    object
    RegexTools
    Namespace: Textify.Tools
    Assembly: Textify.dll
    Syntax
    public static class RegexTools

    Methods

    | Edit this page View Source

    Filter(string, string)

    Filters the string from the substrings matched by the given pattern

    Declaration
    public static string Filter(string text, string pattern)
    Parameters
    Type Name Description
    string text

    The text to be processed

    string pattern

    Regular expression pattern for replacing

    Returns
    Type Description
    string

    Filtered text

    | Edit this page View Source

    Filter(string, string, string)

    Filters the string from the substrings matched by the given pattern

    Declaration
    public static string Filter(string text, string pattern, string replaceWith)
    Parameters
    Type Name Description
    string text

    The text to be processed

    string pattern

    Regular expression pattern for replacing

    string replaceWith

    Replaces the matched substrings with the specified text

    Returns
    Type Description
    string

    Filtered text

    | Edit this page View Source

    IsMatch(string, string)

    Checks to see whether the pattern matches

    Declaration
    public static bool IsMatch(string text, string pattern)
    Parameters
    Type Name Description
    string text

    The text to be matched

    string pattern

    Regular expression pattern for matching

    Returns
    Type Description
    bool

    True if there are matches. Otherwise, false

    | Edit this page View Source

    IsValidRegex(string)

    Determines whether the specified regular expression pattern is valid or not

    Declaration
    public static bool IsValidRegex(string pattern)
    Parameters
    Type Name Description
    string pattern

    Specified pattern

    Returns
    Type Description
    bool

    True if valid; false otherwise

    | Edit this page View Source

    IsValidRegex(Regex)

    Determines whether the specified regular expression pattern is valid or not

    Declaration
    public static bool IsValidRegex(Regex pattern)
    Parameters
    Type Name Description
    Regex pattern

    Specified pattern

    Returns
    Type Description
    bool

    True if valid; false otherwise

    | Edit this page View Source

    Match(string, string)

    Matches the pattern with the text given

    Declaration
    public static Match Match(string text, string pattern)
    Parameters
    Type Name Description
    string text

    The text to be matched

    string pattern

    Regular expression pattern for matching

    Returns
    Type Description
    Match

    A System.Text.RegularExpressions.Match that contains information about the current match

    | Edit this page View Source

    Matches(string, string)

    Matches the pattern with the text given

    Declaration
    public static MatchCollection Matches(string text, string pattern)
    Parameters
    Type Name Description
    string text

    The text to be matched

    string pattern

    Regular expression pattern for matching

    Returns
    Type Description
    MatchCollection

    Collection of System.Text.RegularExpressions.Matches that contains information about the current match

    | Edit this page View Source

    ParseRegex(string)

    Parses the regular expression pattern after validating it

    Declaration
    public static Regex ParseRegex(string pattern)
    Parameters
    Type Name Description
    string pattern

    Specified pattern

    Returns
    Type Description
    Regex

    Regular expression instance of a valid regular expression pattern

    | Edit this page View Source

    Split(string, string)

    Splits the string using the matched substrings as the delimiters

    Declaration
    public static string[] Split(string text, string pattern)
    Parameters
    Type Name Description
    string text

    The text to be split

    string pattern

    Regular expression pattern for splitting

    Returns
    Type Description
    string[]

    Array of strings

    | Edit this page View Source

    TryParseRegex(string, out Regex?)

    Parses the regular expression pattern after validating it

    Declaration
    public static bool TryParseRegex(string pattern, out Regex? result)
    Parameters
    Type Name Description
    string pattern

    Specified pattern

    Regex result

    [out] Resultant regular expression instance

    Returns
    Type Description
    bool

    True if valid; false otherwise

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX