连接1:正则表达式语言元素
正则表达式的使用:
Regex r;
Match m;
r = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
for(m = r.Match(input); m.Success; m = m.NextMatch())
{
System.Console.WriteLine(m.ToString());
}
//Replace:dest = System.Text.RegularExpressions.Regex.Replace(src, pattern, replacement, RegexOptions.Multiline);
//Match:System.Text.RegularExpressions.Regex.Match("in", "i", System.Text.RegularExpressions.RegexOptions.Multiline).Success
//===============================================================================================//
//===============================================================================================//
1. 在C#中,怎么用正则表达式匹配出没有被注释的中文?
如:
//这是被注释的中文
//"这也是被注释的中文"
#region 这是被注释的中文
#endregion
#region "这都是被注释的中文"
#endregion "这都是被注释的中文"
string str="这是没有被注释的中文";
this.cmdDel.Attributes.Add("onClick","return IsCheckBoxChecked('这是被注释的中文吗?','不是!')");
string str="这是没有被注释的中文";
//this.cmdDel.Attributes.Add("onClick","return IsCheckBoxChecked('这是被注释的中文吗?','是的!')");
2.
浙公网安备 33010602011771号