I need to split a string like the one below, based on space as the delimiter. But any space within a quote should be preserved.
research library "not available" author:"Bernard Shaw"
to
research
library
"not available"
author:"Bernard Shaw"
I am trying to do this in C Sharp, I have this Regex: @"(?<="")|w[ws]*(?="")|w+|""[ws]*"""
from another post in SO, which splits the string into
research
library
"not available"
author
"Bernard Shaw"
which unfortunately does not meet my exact requirements.
I'm looking for any Regex, that would do the trick.
Any help appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…