【发布时间】:2013-06-26 02:46:39
【问题描述】:
我需要查找小写或大写文本(使用正则表达式) 我的代码:
static void Main(string[] args)
{
String s = "String : hello Hello HELLO hEllo ";
String patern = @"(hello)";
Regex myRegex = new Regex(patern);
foreach (Match regex in myRegex.Matches(s)) {
Console.WriteLine(regex.Value.ToString());
}
}
结果:
hello
我需要结果
hello
Hello
HELLO
hEllo
你能帮帮我吗?
【问题讨论】:
-
通常使用修饰符
i来完成。"/hello/i" -
不是结果。我不知道