我想将[img1.gif] 替换成<img src='/images/face/img1.gif'>
改怎么写,请各位帮帮忙啊。

解决方案 »

  1.   

    public Regex MyRegex = new Regex(
          "\\[(?<filename>[^\\]]*)\\]",
        RegexOptions.IgnoreCase
        | RegexOptions.CultureInvariant
        | RegexOptions.IgnorePatternWhitespace
        | RegexOptions.Compiled
        );
    // This is the replacement string
    public string MyRegexReplace = 
          "<img src='/images/face/${filename}'>";
    //// Replace the matched text in the InputText using the replacement pattern
    // string result = MyRegex.Replace(InputText,MyRegexReplace);
      

  2.   

    有回复了。试试看,多谢fancyf(凡瑞)
      

  3.   

    再次谢谢fancyf(凡瑞),可以用了。 还要谢谢cctv ,mtv,我的经纪人。