<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>测试</title>
</head>
<body>
{@Html_Body|type|count}
<BR />
{IGetNewsByType(1, DateTime,Desc,10,true,true)}
</body>
</html>
请教下应该怎么用正则找出这里面的
{@Html_Body|type|count}

{IGetNewsByType(1, DateTime,Desc,10,true,true)}呢

解决方案 »

  1.   

    MatchCollection m = Regex.Matches(Templates, @"{@(\w+\([\w,]+\)})");
      

  2.   


            string pstr = @"\{((?!\{).)+\}";
      

  3.   

    Regex reg = new Regex(@"(?<=\{)[^{}]+(?=\})");
                MatchCollection mc = reg.Matches("");
                foreach (Match m in mc)
                {
                    TextBox1.Text += m.Value + "\n";
                }