[ shadeslab @ 15.07.2009. 08:36 ] @
eeee ovako imam html tag koji hocu da parsujem samo ne umem da napisem pattern pa ako neko moze da mi pomogne bio bih mu jako zahvalan. ovo je kod u koji to trebam da ubacim Code: public static void Main() { MatchCollection mc; String[] results = new String[20]; int[] matchposition = new int[20]; // Create a new Regex object and define the regular expression. Regex r = new Regex(@"<h2\b[^>]*>(.*?)</h2>"); // Use the Matches method to find all matches in the input string. mc = r.Matches("<h1>This is a heading</h1><h2>This is a heading</h2><h3>This is a heading</h3> "); // Loop through the match collection to retrieve all // matches and positions. for (int i = 0; i < mc.Count; i++) { // Add the match string to the string array. results[i] = mc[i].Value; // Record the character position where the match was found. matchposition[i] = mc[i].Index; Console.WriteLine(results[i] + "," + matchposition[i].ToString()); } // RunTest(); } ovoo gore radi super eeeeeee sad ja zelim isto to samo sa ovim html tagom Code: <table width="468" bgcolor="#666666" cellspacing="0" cellpadding="0" border="0"> </table> hvala unapred .... |