|
Match Object
The matched string, the index of the start of the matched string in the target string, and the length of the match.
Dim s
Dim rgxp
s = "Peter Piper picked a peck of pickled peppers."
Set rgxp = New RegExp
rgxp.Pattern = "p"
rgxp.IgnoreCase = False
rgxp.Global = True
Set matches = rgxp.Execute(s)
Response.Write "Testing for the pattern " &
Chr(34) &
rgxp.Pattern & Chr(34) & " in the string "
&
Chr(34) & s & Chr(34) & "<br><br>"
For Each aMatch In matches
Response.Write "Found a match at position " &
aMatch.FirstIndex & " Matched string=" &
Chr(34) & aMatch.Value & Chr(34) & ". " &
aMatch.Length & " character(s) were matched." & "<br>"
Next
|