System.Text.RegularExpressions 命名空间

System.Text.RegularExpressions 命名空间包含提供 .NET 正则表达式引擎访问权限的类。 The System.Text.RegularExpressions namespace contains classes that provide access to the .NET regular expression engine. 该命名空间提供了可在 .NET 中运行的任何平台或语言中使用的正则表达式功能。 The namespace provides regular expression functionality that may be used from any platform or language that runs within .NET. 除了此命名空间中包含的类型外,RegexStringValidator 类还允许您确定特定字符串是否与某个正则表达式模式相符。 In addition to the types contained in this namespace, the RegexStringValidator class enables you to determine whether a particular string conforms to a regular expression pattern.

Capture

表示来自单个成功子表达式捕获的结果。Represents the results from a single successful subexpression capture.

CaptureCollection

表示单个捕获组执行的捕获集。Represents the set of captures made by a single capturing group. 该集合是不可变的(只读),没有公共构造函数。The collection is immutable (read-only) and has no public constructor.

Group

表示来自单个捕获组的结果。Represents the results from a single capturing group.

GroupCollection

返回一次匹配中捕获的组的集。Returns the set of captured groups in a single match. 该集合是不可变的(只读),没有公共构造函数。The collection is immutable (read-only) and has no public constructor.

Match

表示单个正则表达式匹配的结果。Represents the results from a single regular expression match.

MatchCollection

表示通过以迭代方式将正则表达式模式应用于输入字符串所找到的成功匹配的集合。Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string. 集合 (只读) 不可变,并且没有公共构造函数。The collection is immutable (read-only) and has no public constructor. Matches(String) 方法将返回 MatchCollection 对象。The Matches(String) method returns a MatchCollection object.

Regex

表示不可变的正则表达式。Represents an immutable regular expression.

RegexCompilationInfo

提供有关使用正则表达式将正则表达式编译为独立程序集的信息。Provides information about a regular expression that is used to compile a regular expression to a stand-alone assembly.

RegexMatchTimeoutException

正则表达式模式匹配方法的执行时间超出其超时时间间隔时引发的异常。The exception that is thrown when the execution time of a regular expression pattern-matching method exceeds its time-out interval.

RegexParseException

正则表达式中的分析错误导致的异常,ErrorOffset 属性中包含了详细信息。An exception as a result of a parse error in a regular expression, with detailed information in the Error and Offset properties.

RegexRunner

RegexRunner 类是编译正则表达式的基类。The RegexRunner class is the base class for compiled regular expressions.

RegexRunnerFactory

为编译过的正则表达式创建 RegexRunner 类。Creates a RegexRunner class for a compiled regular expression.

枚举

RegexOptions

提供用于设置正则表达式选项的枚举值。Provides enumerated values to use to set regular expression options.

RegexParseError

指定当正则表达式包含分析错误时引发 RegexParseException 的详细基本原因。Specifies the detailed underlying reason why a RegexParseException is thrown when a regular expression contains a parsing error.

委托

MatchEvaluator

表示此方法,此方法于每次在 Replace 方法操作期间找到单一正则表达式匹配时调用。Represents the method that is called each time a regular expression match is found during a Replace method operation.

另请参阅