Salut..

J'ai un problème avec les expressions régulières. En fait pas vraiment mais seulement sur le vb.net.

Voilà la situation :
J'ai un fichier sous forme
<TITLE>
This is a title
</TITLE>

<SUBTITLE>
This is the 1st subtitle
</SUBTITLE>

<TEXT>
This is some text for the 1st paragraph......
</TEXT>

<SUBTITLE>
This is the 2nd subtitle
</SUBTITLE>

<TEXT>
This is some text for the 2nd paragraph......
</TEXT>
et je veux extraire ce qui est entre les balises <xxx> et </xxx> alors j'ai écris mon motif comme
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
        pat = "<(.*)>(\n*)(.*?)(\n*)</(.*)>"
        content = "le texte du fichier..."
 
        Dim r As New Regex(pat, RegexOptions.Multiline And RegexOptions.IgnoreCase)
        Dim mc As MatchCollection = r.Matches(content)
 
        Dim c As Capture
        Dim cc As CaptureCollection
 
        For Each m As Match In mc
            cc = m.Captures
            For Each c In cc
                s &= "capture = [" & c.Value & "]" & vbCr
                Me.resultat.AppendText(s & "   ****  " & vbCr)
            Next
        Next
mais ça m'affiche
[<TITLE>
This is a title
</TITLE>]
****
[<TITLE>
This is a title
</TITLE>]
[<SUBTITLE>
This is the 1st subtitle
</SUBTITLE>]
****
[<TITLE>
This is a title
</TITLE>]
[<SUBTITLE>
This is the 1st subtitle
</SUBTITLE>]
[<TEXT>
This is some text for the 1st paragraph......
</TEXT>]
****
......
Il m'affiche le [1er match] puis le [1er match + 2eme match] puis le [1er match + 2eme match + 3eme match]...... je ne comprend pas ces résultats.

comment pourrait je extraire les chaines qui sont entre les <xxx> et </xxx>