
February 15th, 2013, 11:34 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 2
Time spent in forums: 14 m 13 sec
Reputation Power: 0
|
|
|
Other - 'net Regex Help
Hi folks , Im new to regex and was hoping someone might be able to give me some advice.
Im trying to use regex in VB.Net to split a string whenever there is a space except when it between quotes. I also want to keep the quotes.
I tried using \s+(?=([^""]*""[^""]*""[^""]*)*$|[^""]*$)
and it works on most string but here are a few lines that it doesnt work on !
/config/userctrl/A/enc "X001" "X101" "X201" "X300"
I want to get
/config/userctrl/A/enc
"X001"
"X101"
"X201"
"X300"
But get
/config/userctrl/A/enc
"X300"
"X001"
"X300"
"X101"
"X300"
"X201"
"X300"
"X300"
Same thing happens with
/config/userctrl/A/btn "O40" "O42" "X201" "X300" "P0051" "P0052" "P0053" "P0058"
and /ch/01/config "Drum Room" 2 CY 1
gives me
/ch/01/config
"Drum Room" 2 CY 1
"Drum Room"
2
CY
1
Where am I going wrong ???
Thanks in advance for any help you can give
Kev
|