Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Regex html table tag pattern

[es] :: .NET :: Regex html table tag pattern

[ Pregleda: 1209 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

shadeslab

Član broj: 50399
Poruke: 3
*.static.isp.telekom.rs.



Profil

icon Regex html table tag pattern15.07.2009. u 08:36 - pre 179 meseci
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 ....
 
Odgovor na temu

[es] :: .NET :: Regex html table tag pattern

[ Pregleda: 1209 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.