title: How to make my split work only on one real line and be capable to skip quoted parts of string?
body: <p>So we have a <a href="https://stackoverflow.com/questions/236129/how-to-split-a-string-in-c/236180#236180">simple split</a>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;iterator&gt;
  using namespace std;
  
  vector&lt;string&gt; split(const string&amp; s, const string&amp; delim, const bool keep_empty = true) {
      vector&lt;string&gt; result;
      if (delim.empty()) {
          result.push_back(s);
          return result;
      }
      string::const_iterator substart = s.begin(), subend;
      while (true) {
          subend = search(substart, s.end(), delim.begin(), delim.end());
          string temp(substart, subend);
          if (keep_empty || !temp.empty()) {
              result.push_back(temp);
          }
          if (subend == s.end()) {
              break;
          }
          substart = subend + delim.size();
      }
      return result;
  }
  </code></pre>
  
  <p>or <a href="http://www.boost.org/doc/libs/1_41_0/doc/html/string_algo/usage.html#id1701774" rel="nofollow noreferrer">boost split</a>. And we have simple main like:</p>
  
  <pre><code>int main() {
      const vector&lt;string&gt; words = split("close no \"\n matter\" how \n far", " ");
      copy(words.begin(), words.end(), ostream_iterator&lt;string&gt;(cout, "\n"));
  }
  </code></pre>
  
  <p>how to make it oputput something like</p>
  
  <pre><code>close 
  no
  "\n matter"
  how
  end symbol found.
  </code></pre>
  
  <p>we want to introduce to split <code>structures</code> that shall be held unsplited and charecters that shall end parsing process. how to do such thing? </p>