Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How to entre a "pattern" in a column chart? "used to be in 2003" | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |