[a, b, c, "d, e, f", g, h]
a、b、c、 "d、e、f"、g、hの6つの要素の配列に変換することを探しています。私はJavascriptを介してこれを行おうとしています。これは私がこれまでに持っているものです:
str = str.split(/,+|"[^"]+"/g);
しかし、現在、二重引用符で囲まれているものはすべて分割されていますが、これは正しくありません。
編集:申し訳ありませんが、私はこの質問の言い回しが非常に貧弱でした。配列ではなく文字列が与えられています。
var str = 'a, b, c, "d, e, f", g, h';
そして、「分割」関数のようなものを使用して、それを配列に変換したいと思います。