Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Problems with Reg Pattern "[^"]\$[A-Z]*[0-9]"

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Problems with Reg Pattern "[^"]\$[A-Z]*[0-9]"


Not sure, but I think I read something about that before.... and they used
double quotes...

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



"ExcelMonkey" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Reg Pattern "[^"]\$[A-Z]*[0-9]"

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


"ExcelMonkey" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Problems with Reg Pattern "[^"]\$[A-Z]*[0-9]"

On Tue, 27 May 2008 08:59:01 -0700, ExcelMonkey
wrote:

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



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

should work just fine.

--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How to entre a "pattern" in a column chart? "used to be in 2003" Mecckey Excel Discussion (Misc queries) 1 June 7th 08 02:28 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 09:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"