Question : RegExp VBA for HTML tags - Needs assistance and explanations

Dear Experts,

I need someone to walk me through a regexp pattern. I have an HTML source body to manipulate and I need to extract the following info in VBA.
First get the data between <!-- item and the following </tr>
Then inside that split, get all the info between the tags in an array.

This should be simple for anybody familiar with RegExp, but I'd like an explanation of the different parts of the pattern. I have read Patrick Matthew's article, I like it, but I still need additional guidance,

Attached are a sample text file and the code I'm currently using (without a valid pattern)

Thanks,

Thomas
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Sub testingRegExp()
Dim strBody As String
Dim intFile As Integer

intFile = FreeFile

Open "C\strbody.txt" For Input As #intFile
   strBody = Input$(LOF(intFile), #intFile)  '  LOF returns Length of File
Close #intFile

Dim RegX As Object, Mats As Object, Counter As Long

Set RegX = CreateObject("VBScript.RegExp")
With RegX
    .Global = True
    .MultiLine = True
    .IgnoreCase = True
    .Pattern = "TO BE DEFINED"
    Set Mats = .Execute(strBody)
End With

For Counter = 0 To Mats.Count - 1
    Debug.Print Mats(Counter)
Next

Set Mats = Nothing
Set RegX = Nothing

End Sub
Attachments:
 
HTML Source file
 

Answer : RegExp VBA for HTML tags - Needs assistance and explanations


DoCmd.OpenForm "frm_CampaignDetail",acNormal,,"CampaignID = " & Me.CampaignID,,acDialog
Random Solutions  
 
programming4us programming4us