123asp.com替换为
<http href=http://www.123aspx.com>123asp.com</a>替换为
Regex的pattern该怎么写?
大家不会看不懂吧?这么多学C#竟然都不知道这语法?晕

解决方案 »

  1.   

    这么多分, :) 为什么 不用string.replace  ??
      

  2.   

    什么是“正则表达式”?这个问题是关于什么的?asp.net?
      

  3.   

    匆忙乱写了一个,不知道行不行using System;
    using System.Text.RegularExpressions;namespace RegExp
    {
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
    static void Main(string[] args)
    {
    string source="123asp.com";
    //<http href==http://www.123aspx.com>123asp.com</html> string result=Regex.Replace(source,"\\[url=(?<a>[^\\]]*).(?<b>[^\\[]*).*","<http href==${a}>${b}</html>"); Console.WriteLine(result); Console.ReadLine(); //
    // TODO: Add code to start application here
    //
    }
    }
    }
      

  4.   

    错了
    应该是
    string result=Regex.Replace(source,"\\[url=(?<a>[^\\]]*)\\](?<b>[^\\[]*).*","<http href==${a}>${b}</html>");
      

  5.   

    回答基本正确,当然要给分,不过因为我急用,早就解决问题了,谢谢大家参与,ripper,可以留下你的 oicq或 e_mail吗?
      

  6.   

    ripper◎elong。com
    webservice.xici.net共同进步;)