View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default Help with a regex pattern please

On Thu, 20 Mar 2008 16:55:57 -0700 (PDT), wrote:

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?

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]"


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

You have some optional arguments (I think, I don't recognize the syntax)
that I've removed. This just uses the pipe to separate the three choices.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com