Hello,
I need to get the string of the line that is enclosed within the square brackets.
I try to use the following regular expression, but I keep getting a syntax error.
str = "[This is the data]"
Set objRE = New RegExp
With objRE
.IgnoreCase = True
.Global = True
.Pattern = = "\[(.*)\]"
End With
Set colItems = objRE.Execute(str)
For Each objItem in colItems
Wscript.Echo objItem.SubMatches(0)
Next
What would be the pattern to extract the data within
the square brackets?
Thanks
I need to get the string of the line that is enclosed within the square brackets.
I try to use the following regular expression, but I keep getting a syntax error.
str = "[This is the data]"
Set objRE = New RegExp
With objRE
.IgnoreCase = True
.Global = True
.Pattern = = "\[(.*)\]"
End With
Set colItems = objRE.Execute(str)
For Each objItem in colItems
Wscript.Echo objItem.SubMatches(0)
Next
What would be the pattern to extract the data within
the square brackets?
Thanks