099099.com|桂ICP备08000288号|黄俊添
1000gouwu.com|冀ICP备09050878号|康志涛
1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
101wm.com|皖ICP备06013913号|许敏和
只需要
099099.com
1000gouwu.com用ultradit 怎么样 

解决方案 »

  1.   

            string str = @"099099.com|桂ICP备08000288号|黄俊添
    1000gouwu.com|冀ICP备09050878号|康志涛
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
    101wm.com|皖ICP备06013913号|许敏和
    ";
            MatchCollection mc = Regex.Matches(str, @"(?m)^[^\|]+");
            foreach (Match m in mc)
            {
                Response.Write(m.Value + "\r\n");
            }
    结果:
    099099.com
    1000gouwu.com
    1001-w1000gouwu.comish.com
    101wm.com
      

  2.   

    string str = @"099099.com|桂ICP备08000288号|黄俊添
    1000gouwu.com|冀ICP备09050878号|康志涛
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
    101wm.com|皖ICP备06013913号|许敏和
    ";
            MatchCollection mc = Regex.Matches(str, @"(?is)\w[^-]+\.com");
            foreach (Match m in mc)
            {
                Response.Write(m.Value + "\r\n");
            }
      

  3.   

    不明白你到底要干嘛……        string str = @"099099.com|桂ICP备08000288号|黄俊添
    1000gouwu.com|冀ICP备09050878号|康志涛
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
    101wm.com|皖ICP备06013913号|许敏和
    ";
            str = Regex.Replace(str, @"(?m)(?<=^[^\|]+)\|.*?$", "");
            Response.Write(str);
      

  4.   

    我是说直接用ultraedit替换 这个不要写在C#里
      

  5.   

    string str = @"099099.com|桂ICP备08000288号|黄俊添
    1000gouwu.com|冀ICP备09050878号|康志涛
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
    101wm.com|皖ICP备06013913号|许敏和
    ";
                MatchCollection mc = Regex.Matches(str, @"(.+\.)+com");
                foreach (Match m in mc)
                {
                    Response.Write(m.Value + "<br/>");
                }
      

  6.   

    还要改下:string str = @"099099.com|桂ICP备08000288号|黄俊添
    1000gouwu.com|冀ICP备09050878号|康志涛
    1001-w1000gouwu.comish.com|辽ICP备09028978号|大连吸引力传媒有限公司
    101wm.com|皖ICP备06013913号|许敏和
    ";
                MatchCollection mc = Regex.Matches(str, @"(.+\.)[^\|]+");
                foreach (Match m in mc)
                {
                    Response.Write(m.Value + "<br/>");
                }
      

  7.   

    用PilotEdit Lite的正则表达式替换:查找:
    ^*.com|*$替换为
    %01.com这是替换后的结果:
    099099.com
    1000gouwu.com
    1001-w1000gouwu.comish.com
    101wm.com