110,571
社区成员
发帖
与我相关
我的任务
分享
void Main()
{
string str=@"我的意思是 ""里面是汉字!""引号和汉字要一起匹配";
Console.WriteLine(Regex.Match(str,@"""[\u4e00-\u9fa5!]+""").Value);
//"里面是汉字"
}
void Main()
{
string str=@"我的意思是 ""里面是汉字""引号和汉字要一起匹配";
Console.WriteLine(Regex.Match(str,@"""[\u4e00-\u9fa5]+""").Value);
//"里面是汉字"
}
void Main()
{
string str=@"单引号的杂不行 像后台写的 <script>alert('里面是中文')</sciprt> ";
Console.WriteLine(Regex.Match(str,@"'[\u4e00-\u9fa5!]+'").Value);
//'里面是中文'
}