RegexOptionsInterop Class

Converts between RegexPatternOptions and the .NET engine's own options.

public static class RegexOptionsInterop

Remarks

Only the options that change how a pattern is read are represented. Compiled, RightToLeft, CultureInvariant, and NonBacktracking affect matching, which this library does not do, so they are dropped in both directions.

Methods

NameDescription
ToPatternOptions(RegexOptions)Maps the .NET options that affect parsing onto dialect-neutral options.
ToRegexOptions(RegexPatternOptions)Maps dialect-neutral options back onto .NET options. Options with no .NET equivalent are dropped.

ToPatternOptions(RegexOptions)

RegexOptionsInterop.cs

Maps the .NET options that affect parsing onto dialect-neutral options.

public static RegexPatternOptions ToPatternOptions(RegexOptions options)

Parameters

options RegexOptions

Returns

RegexPatternOptions

ToRegexOptions(RegexPatternOptions)

RegexOptionsInterop.cs

Maps dialect-neutral options back onto .NET options. Options with no .NET equivalent are dropped.

public static RegexOptions ToRegexOptions(RegexPatternOptions options)

Parameters

options RegexPatternOptions

Returns

RegexOptions