View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] be_675@hotmail.com is offline
external usenet poster
 
Posts: 7
Default Help with a regex pattern please

I have three individual sPattern's that I am working on. How can I
merge them together so that the pattern will look for three digits
followed by either a period, or by a space and a period, or by a space
and a letter?

Thanks

Const sPattern As String = "d{1,3}(?=\.)"
Const sPattern As String = "d{1,3}[\ ][\.]"
Const sPattern As String = "d{1,3}[\ ][?=\A-Z,a-z]"

Set oRegex = New RegExp
oRegex.Pattern = sPattern
oRegex.Global = True

If oRegex.Test(strIn) = True Then
Set colMatches = oRegex.Execute(strIn)
strData = colMatches(0)
End If