I was wondering if someone could point me to a resource where I could find the syntax of the methods used in a regular expression in VBA. Right now I'm using this code in Excel to find a zip code with a bracket:
Thing is, I had to do a lot of searching around at tek-tips to find the syntax for "RgExp.Test". There's plenty of info at Microsoft on building the pattern, but then what you can do with the RgExp object itself is a bit of a mystery to me, and the VBA editor was unable to provide me with any information either.
So far, off the top of my head, I know of:
RgExp.Test(str)
RgExp.Replace(str,"yourstring")
I just downloaded the VBScript documentation from Microsoft and I know there's more information in there. Is that the only place, or is there a nify online list of these regular expression methods?
Thanks!!
Thanks!!
Matt
Code:
Sub MatchString()
Dim RgExp As Object
Dim str As String
str = "Bloomfield, NJ 07003], 509 [Broad St]"
Set RgExp = CreateObject("VBScript.RegExp")
RgExp.Pattern = "\d{5}\]"
Debug.Print RgExp.Test(str)
End Sub
Thing is, I had to do a lot of searching around at tek-tips to find the syntax for "RgExp.Test". There's plenty of info at Microsoft on building the pattern, but then what you can do with the RgExp object itself is a bit of a mystery to me, and the VBA editor was unable to provide me with any information either.
So far, off the top of my head, I know of:
RgExp.Test(str)
RgExp.Replace(str,"yourstring")
I just downloaded the VBScript documentation from Microsoft and I know there's more information in there. Is that the only place, or is there a nify online list of these regular expression methods?
Thanks!!
Thanks!!
Matt