正则式

 Regex rx = new Regex(@"(\<IMG )[^\u4e00-\u9fa5]*(src="")[\w_\-]+\.\w{3,}""[^\u4e00-\u9fa5]*\>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
            Regex rx1 = new Regex(@"( src="")[\w_\-]+\.\w{3,}""", RegexOptions.IgnoreCase | RegexOptions.Multiline);
            Match ma = rx.Match(textBox1.Text);
            while (ma.Success)
            {
                string src=rx1.Match(ma.Value).Value;
                textBox2.Text += src.Substring(6, src.Length - 7);           
                ma = ma.NextMatch();
            }
posted @ 2009-03-09 20:20  Jinny  阅读(211)  评论(0编辑  收藏  举报