Skip to content

Commit fc53a3a

Browse files
authored
Fix RegexOptions.ECMAScript combinations (#49453)
`ECMAScript` can be used in conjunction with `Compiled` according to https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.regexoptions
1 parent 4d12ca0 commit fc53a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/standard/base-types/regular-expression-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ By default, the regular expression engine uses canonical behavior when matching
333333
> [!NOTE]
334334
> ECMAScript-compliant behavior is available only by supplying the <xref:System.Text.RegularExpressions.RegexOptions.ECMAScript?displayProperty=nameWithType> value to the `options` parameter of a <xref:System.Text.RegularExpressions.Regex> class constructor or static pattern-matching method. It is not available as an inline option.
335335
336-
The <xref:System.Text.RegularExpressions.RegexOptions.ECMAScript?displayProperty=nameWithType> option can be combined only with the <xref:System.Text.RegularExpressions.RegexOptions.IgnoreCase?displayProperty=nameWithType> and <xref:System.Text.RegularExpressions.RegexOptions.Multiline?displayProperty=nameWithType> options. The use of any other option in a regular expression results in an <xref:System.ArgumentOutOfRangeException>.
336+
The <xref:System.Text.RegularExpressions.RegexOptions.ECMAScript?displayProperty=nameWithType> option can be combined only with the <xref:System.Text.RegularExpressions.RegexOptions.IgnoreCase?displayProperty=nameWithType>, <xref:System.Text.RegularExpressions.RegexOptions.Multiline?displayProperty=nameWithType>, and <xref:System.Text.RegularExpressions.RegexOptions.Compiled?displayProperty=nameWithType> options. The use of any other option in a regular expression results in an <xref:System.ArgumentOutOfRangeException>.
337337

338338
The behavior of ECMAScript and canonical regular expressions differs in three areas: character class syntax, self-referencing capturing groups, and octal versus backreference interpretation.
339339

0 commit comments

Comments
 (0)