Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Problems with Reg Pattern "[^"]\$[A-Z]*[0-9]"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ExcelMonkey - 27 May 2008 16:59 GMT
I am having a problem usng this regex pattern in VBA:

[^"]\$[A-Z]*[0-9]

When I put it into quotes:

"[^"]\$[A-Z]*[0-9]"

It highlights the first ] and says Invalid Character.

I am assuming that it has something to do with the way VBA uses quotes for
text strings.  What do I have to do to get around this?

Thanks

EM
dougw - 27 May 2008 17:19 GMT
Not sure, but I think I read something about that before.... and they used
double quotes...

""[^\$[A-Z\*[0-9]""

>I am having a problem usng this regex pattern in VBA:
>
[quoted text clipped - 12 lines]
>
> EM
Rick Rothstein (MVP - VB) - 27 May 2008 17:19 GMT
I do not work with RegEx myself (or at least I haven't for many, many years
now), but I think your problem is with the embedded quote mark. You must
double them up with inside a String constant (text with quote marks at the
beginning and end of the text). Try this pattern and see if it works...

"[^""]\$[A-Z]*[0-9]"

Rick

>I am having a problem usng this regex pattern in VBA:
>
[quoted text clipped - 12 lines]
>
> EM
Ron Rosenfeld - 27 May 2008 17:55 GMT
>I am having a problem usng this regex pattern in VBA:
>
[quoted text clipped - 12 lines]
>
>EM

"[^""]\$[A-Z]*[0-9]"

should work just fine.

--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.