【.net】关于RegexOptions中的各个枚举值的含义

  Member name Description
  Compiled

Specifies that the regular expression is compiled to an assembly. This yields faster execution but increases startup time. This value should not be assigned to the Options property when calling the CompileToAssembly method. For more information, see the "Compiled Regular Expressions" section in the Regular Expression Options topic.

  CultureInvariant

Specifies that cultural differences in language is ignored. For more information, see the "Comparison Using the Invariant Culture" section in the Regular Expression Options topic.

  ECMAScript

Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the IgnoreCase, Multiline, and Compiled values. The use of this value with any other values results in an exception.

For more information on the RegexOptions.ECMAScript option, see the "ECMAScript Matching Behavior" section in the Regular Expression Options topic.

  ExplicitCapture

Specifies that the only valid captures are explicitly named or numbered groups of the form (?<name>…). This allows unnamed parentheses to act as noncapturing groups without the syntactic clumsiness of the expression (?:…).

指捕获显示命名或数字的分组,匿名的不会捕获

  IgnoreCase

忽略大小写

  IgnorePatternWhitespace

Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in , numeric , or tokens that mark the beginning of individual.

  Multiline

Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string. For more information, see the "Multiline Mode" section in the Regular Expression Options topic.

多行模式。^ 和 $匹配开始和结束的位置。

  None

没有选项

  RightToLeft

从右向左匹配

  Singleline

单行模式

上一篇:Spring Boot Actutaur + Telegraf + InFluxDB + Grafana 构建监控平台


下一篇:【安富莱二代示波器教程】第16章 附件A---电阻屏触摸校准