Lee,
What are you expecting as output?
Reading "within each set of quotes" it sounds like you expect a 2 element
array with:
(0) = "X:Y\Z.exe"
(1) = "123"
I would use a pattern such as "(?<value>.*?)" (including quotes), and use a
loop to find each match.
Something like:
Dim input As String = """X:Y\Z.exe"" ""123"""
Dim pattern As String = """(?<value>.*?)"""
Static parser As New System.Text.RegularExpressions.Regex(pattern,
RegularExpressions.RegexOptions.Compiled)
Dim list As New ArrayList
Dim match As match = parser.Match(input)
Do While match.Success
list.Add(match.Groups("value").Value)
match = match.NextMatch()
Loop
Expresso & RegEx Workbench both have wizards of varying degrees to help you
build your expression, plus they allow you to test your expressions, also
the analyzer/interpreter in each is rather handy.
Expresso:
http://www.ultrapico.com/Expresso.htm
RegEx Workbench:
http://www.gotdotnet.com/Community/U...-4ee2729d7322A
tutorial & reference on using regular expressions:
http://www.regular-expressions.info/
The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Hope this helps
Jay
"lgbjr" <lg***@online.nospam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello All,
I have the following type of string: "X:Y\Z.exe" "123"
What I need is an array of strings with the information from within each
set of quotes. I was trying to use a Regex.Split, but I can't figure out
how to escape a quote. The closest I got was Regex.split(String,"(\"")"),
which gives me an array of strings:
"X:Y\Z.exe
"
"123
I thought that using (\") would be what I needed (escaping a single
quote), but that produces a syntax error.
Can someone tell me the correct syntax for a Regex expression to split on
a quote. Or, if there's a better way to do this, I'm open to suggestions.
TIA,
Lee