static string[] getImages(string source) { //get all the images MatchCollection mr; String[] thumbs = new String[20]; // Create a new Regex object and define the regular expression. // begginning with http and ending with JPG ignoring case Regex a = new Regex("http://([^<]+).JPG", RegexOptions.IgnoreCase); // Use the Matches method to find all matches in the input string. mr = a.Matches(source); // Loop through the match collection to retrieve all // matches and positions. for (int i = 0; i < mr.Count; i++) { // Add the match string to the string array. thumbs[i] = mr[i].Value; } //return images in string array return images; }