请问匹配 /*和 */的正则表达式怎么写? 请问匹配 /*的正则表达式怎么写?而匹配*/的呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好像没对啊,我把他想这样的写,报错了。我加了个@,不报错了,但是没对。string left = “^\/\*$”;m = Regex.Match( s , left , RegexOptions.Compiled); 匹配 /*:^\/\*$匹配 */:^\*\/$string left = “^\/\*$”;//你换成英文的双引号string left = @"^\/\*$"; go to http://www.regexlib.com/Search.aspxtype "comment" in the keyword textbox, click on the Search button, or use\/\*((?!\*\/).)*\*\/ xlkg_ss 谢谢,我自己碰运气碰出来了^-^,但是我不知道什么解释,private string left = "(/\\*)";private string right = "(\\*/)";match m ,q;m = Regex.Match( s , left , RegexOptions.Compiled);bLeft = m.Success;q = Regex.Match(s,right,RegexOptions.Compiled);bRight = q.Success; to : usepc我试了不行,我是在.net用c#做的; to : usepc能把你的测试代码给我 看看吗? string ss=@"/*usepc*/";Regex re=new Regex(@"\057\052[a-z]*\052\057");MatchCollection mco=re.Matches(ss);foreach(Match ma in mco){ MessageBox.Show(ma.ToString());} 鼠标滚轮移动不想让滚动条移动,怎么写代码 这样写也是数组吗? 观察者模式中,观察者窗体中的控件不起作用,这是什么原因呢? 请教winform中datagrid如何加入Button控件? erp 有什么工具可以获得一个ActiveX DLL或OCX的CLASSID 水晶报表导出word问题 ??求助(学C#NET,要学哪门数据库语言比较好) winform录制视频的时候,文件很大,怎么让视频文件变小 为什么双击dataGrid个行之间的网络线会产生异常? 关于窗体加载的简单问题 高分求解,DataTable更新到表记录中的问题!!!
我把他想这样的写,报错了。我加了个@,不报错了,但是没对。string left = “^\/\*$”;
m = Regex.Match( s , left , RegexOptions.Compiled);
匹配 */:^\*\/$string left = “^\/\*$”;//你换成英文的双引号string left = @"^\/\*$";
http://www.regexlib.com/Search.aspxtype "comment" in the keyword textbox, click on the Search button, or use\/\*((?!\*\/).)*\*\/
我自己碰运气碰出来了^-^,但是我不知道什么解释,private string left = "(/\\*)";
private string right = "(\\*/)";match m ,q;
m = Regex.Match( s , left , RegexOptions.Compiled);
bLeft = m.Success;
q = Regex.Match(s,right,RegexOptions.Compiled);
bRight = q.Success;
我试了不行,我是在.net用c#做的;
能把你的测试代码给我 看看吗?
Regex re=new Regex(@"\057\052[a-z]*\052\057");
MatchCollection mco=re.Matches(ss);
foreach(Match ma in mco)
{
MessageBox.Show(ma.ToString());
}