devoeger
New member
- Jul 28, 2006
- 1
I'm new to Reg Expressions and VB script, but after doing some seaches, I found that the following works well to return the first value...
Set re = New RegExp
With re
.Pattern = "\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"
.IgnoreCase = True
.Global = True
End With
Set matches = re.Execute(htmlResult)
getadd = matches.item(0).value
msgbox getadd
If I change getadd to...
getadd = matches.item(0).value + ", " + matches.item(1).value
I can get the first 2 values. The problem is I want all of the values (the total number will vary) in the single variable getadd (I want to return all of the matches in a single message box). Any help?
Set re = New RegExp
With re
.Pattern = "\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"
.IgnoreCase = True
.Global = True
End With
Set matches = re.Execute(htmlResult)
getadd = matches.item(0).value
msgbox getadd
If I change getadd to...
getadd = matches.item(0).value + ", " + matches.item(1).value
I can get the first 2 values. The problem is I want all of the values (the total number will vary) in the single variable getadd (I want to return all of the matches in a single message box). Any help?