art_dupond je suis neuneu... oui oui !! | youp,
j'ai une ligne :
<div class="appliesto" id="appliesto" name="appliesto"><h3>The information in this article applies to:</h3><ul><li>Microsoft Outlook Express 6.0 SP1, when used with:<ul> the operating system: Microsoft Windows XP SP1</ul><ul> the operating system: Microsoft Windows Millennium Edition</ul><ul> the operating system: Microsoft Windows 2000 SP2</ul><ul> the operating system: Microsoft Windows 98 Second Edition</ul><ul> the operating system: Microsoft Windows NT 4.0 SP6a</ul></li><li>Microsoft Outlook Express 6.0, when used with:<ul> the operating system: Microsoft Windows XP</ul></li><li>Microsoft Outlook Express 5.5 for Windows 98 Second Edition</li><li>Microsoft Outlook Express 5.5 for Windows Millennium Edition</li><li>Microsoft Outlook Express 5.5 for Windows 2000</li><li>Microsoft Outlook Express 5.5 for Windows NT 4.0</li></ul></div> |
dont je voudrais extraire les paires <li></li>
le problème, c'est qu'il me donne chaque fois toute la ligne comprise entre le premier <li> et le dernier </li>
mon code en VB:
Code :
- Private Sub Command1_Click()
- Dim i As Integer
- Dim moiur As String
- moiur = "<div class=""appliesto"" id=""appliesto"" name=""appliesto""><h3>The information in this article applies to:</h3><ul><li>Microsoft Outlook Express 6.0 SP1, when used with:<ul> the operating system: Microsoft Windows XP SP1</ul><ul> the operating system: Microsoft Windows Millennium Edition</ul><ul> the operating system: Microsoft Windows 2000 SP2</ul><ul> the operating system: Microsoft Windows 98 Second Edition</ul><ul> the operating system: Microsoft Windows NT 4.0 SP6a</ul></li><li>Microsoft Outlook Express 6.0, when used with:<ul> the operating system: Microsoft Windows XP</ul></li><li>Microsoft Outlook Express 5.5 for Windows 98 Second Edition</li><li>Microsoft Outlook Express 5.5 for Windows Millennium Edition</li><li>Microsoft Outlook Express 5.5 for Windows 2000</li><li>Microsoft Outlook Express 5.5 for Windows NT 4.0</li></ul></div>"
- Set ObjRegex = New RegExp
- ObjRegex.Global = True
- ObjRegex.IgnoreCase = True
- ObjRegex.Pattern = "(<li>.*</li> )"
- Set ColMatches = ObjRegex.Execute(moiur)
- If ColMatches.Count > 0 Then
- For i = 0 To ColMatches.Count - 1
- DoEvents
- txtResultat.Text = txtResultat.Text & vbCrLf & ColMatches(i).Value
- Next
- End If
- End Sub
|
je me dis que ca doit être le pattern qui est pas bon, mais je ne sais pas comment arranger ca
une idée ? merci
---------------
oui oui
|