Regex r; Match m; public static string HttpUrlRegex = @"(s?https?://[-_.!~*'()a-zA-Z0-9;/?:@&=+$,%#]+)"; public static string sourceHTML = "http://www.google.com/ http://www.yahoo.com/"; r = new Regex( HttpUrlRegex, RegexOptions.IgnoreCase|RegexOptions.Compiled); m = r.Match( sourceHTML ); while( m.Success ) { Console.WriteLine( m.Groups[ 1 ] ); m = m.NextMatch(); } for ( m = r.Match( sourceText ); m.Success; m = m.NextMatch() ) { Console.WriteLine( m.Groups[1] ); }