我试图将像 Presentation about "Test Driven Development"
这样的字符串拆分成以下数组:
[ 'Presentation',
'about',
'"Behavior Driven Development"' ]
我尝试使用 CSV::parse_line(string, col_sep: ' ')
,但结果是
[ 'Presentation',
'about',
'Behavior Driven Development' ] # I'm missing the quotes here
我也尝试了一些正则表达式的技巧,但我还是一个初学者,没有成功。我猜这对于专业人士来说相当简单,所以也许有人可以指点我正确的方向?谢谢。