求一个正则表达式~!!!!!!!!!!!!!!!!!
admin 发表于 2010-04-21 | 来源:互联网 | 阅读:

我现在想取这个字符串"{xxx:xx:xx}"

比如在(23+2-6+{xxx:xx:xx})*{xxx:xx:xx}中,获取{xxx:xx:xx}

已经有7 个评论
  1. jc2008_828 说:

    没有人吗?

  2. nashliu 说:

    x指什么?任意数字?还是字符?

  3. sbamd 说:

    C# code
    @"\{[^}]*\}"

  4. boysee 说:

    x指什么?任意数字?还是字符?任意字符与数字比如{answer:标签:30}

  5. weiwei 说:

    x指什么?任意数字?还是字符?这句有错把

  6. dbb123 说:

    string regtxt = @"^(?<zheng ze>\{x{3}:x{3}:x{3}\})";Regx reg =new Regx(regtxt);Match myMatch = reg.Macth("you want to make the txt");this.textbox1.Text = myMatch.group["zhengze"];

  7. forestyaser 说:

    try…C# code
    Regex reg = new Regex(@"(?i){[^:]*:[^:]*:[^}]*}");
    MatchCollection mc = reg.Matches(yourStr);
    foreach (Match m in mc)
    {
    richTextBox2.Text += m.Value + "\n";
    }

我要评论

评论功能因故关闭!

请加入我们的QQ群一起参与讨论:群号59400482(500人超级群)


返回首页 | 关于我们 | 联系我们 | 广告合作 | 网站地图 | 友情链接 | 版权声明