Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 单个匹配中有多个RegException?_C#_.net_Regex - Fatal编程技术网

C# 单个匹配中有多个RegException?

C# 单个匹配中有多个RegException?,c#,.net,regex,C#,.net,Regex,在一个Regex.Match方法中是否有使用多个REgexOptions的选项 假设我想在Regex.Match方法中使用RegexOptions.IgnoreCase和RegexOptions.Singleline 我就想这样 Match m=Regex.Match(input,pattern, more than one regexoptions); 可能吗?如果是,如何执行此操作?与所有表示位标志的枚举类型一样,您可以使用按位OR运算符组合多个标志: Match m = Regex.Ma

在一个Regex.Match方法中是否有使用多个REgexOptions的选项

假设我想在Regex.Match方法中使用RegexOptions.IgnoreCaseRegexOptions.Singleline

我就想这样

Match m=Regex.Match(input,pattern, more than one regexoptions);

可能吗?如果是,如何执行此操作?

与所有表示位标志的枚举类型一样,您可以使用按位OR运算符
组合多个标志:

Match m = Regex.Match(
    input, pattern, RegexOptions.IgnoreCase | RegexOptions.Singleline );

有关更多详细信息,请参阅MSDN上的。

这正是
标记属性
枚举
上的含义。这听起来像是一个家庭作业问题。如果不知道
|
,您如何知道
RegexOptions
忽略案例
?如果是的话,你应该把它标记为家庭作业。
Regex.Match(subjectString, @"regex", RegexOptions.Singleline | RegexOptions.IgnoreCase);