把<a href="ftp://ftp.sohu.com">ftp://ftp.sohu.com</a>
替换成ftp://ftp.sohu.com.同时<a href="http://www.sohu.com">http://www.sohu.com</a>
能保持原样.谢谢!
替换成ftp://ftp.sohu.com.同时<a href="http://www.sohu.com">http://www.sohu.com</a>
能保持原样.谢谢!
//////////////////////////////////////////////
MSN:[email protected]请给我一个与您交流的机会!
string pattern = @"<a[^>]*>(?<ftpname>ftp:[^<]*)<[^>]*>";
System.Text.RegularExpressions.Match result = Regex.Match(sourceString,pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase); WL(result.Groups[1].Value);
//////////////////////////////////////////////
MSN:[email protected]请给我一个与您交流的机会!
string str = "<a href=\"ftp://ftp.sohu.com\">ftp://ftp.sohu.com</a>";
Response.Write( Regex.Match( str , reg , RegexOptions.IgnoreCase ).Groups["s"] );
string result = Regex.Replace(yourStr, @"<a[^>]*>(ftp://[^<]*)</a>", "$1", RegexOptions.IgnoreCase);