G
gimme_this_gimme_that
I want to use a VBScript regular expression to parse a string in VBA.
Can some kind soul get this to work?
Thanks.
Sub x()
Dim s As String
s = "First Name: Joe"
Set regEx = CreateObject("VBScript.RegExp")
regEx.Pattern = "First Name: (\w+)"
Set Matches = regEx.Execute(s)
' This statement fails - no such property
Set oMatch = Matches.subMatches(0)
' I can enumerate through Matches but the enumeration doesn't include
"Joe"
End Sub
Can some kind soul get this to work?
Thanks.
Sub x()
Dim s As String
s = "First Name: Joe"
Set regEx = CreateObject("VBScript.RegExp")
regEx.Pattern = "First Name: (\w+)"
Set Matches = regEx.Execute(s)
' This statement fails - no such property
Set oMatch = Matches.subMatches(0)
' I can enumerate through Matches but the enumeration doesn't include
"Joe"
End Sub