I am at my wit ends (being a regex novice). I need to split a string like this
"abc","","av,as","hello world","nice,name"
into
'abc'
'\blank\'
'av,as'
'hello world'
'nice,name'
Using c# or excel vbs, can someone help with the regex expression?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Fairly straightforward:
will work as shown:
It will allow escaped quotes and possible whitespace between quotations, and is POSIX compliant, should you ever need that!
EDIT
I should probably note that it will basically NOT be possible to get the
'\blank\'you specified directly from the regex engine, but would be relatively trivial to get it from code that checks the the length of the match and replaces it if is less than three characters long (as the match will be""if there was an empty string)END EDIT
Please ask if you would like me to break down the expression!