title: Split string by delimiter, but not if it is escaped
body: <p>How can I split a string by a delimiter, but not if it is escaped? For example, I have a string:</p>
  
  <pre><code>1|2\|2|3\\|4\\\|4
  </code></pre>
  
  <p>The delimiter is <code>|</code> and an escaped delimiter is <code>\|</code>. Furthermore I want to ignore escaped backslashes, so in <code>\\|</code> the <code>|</code> would still be a delimiter.</p>
  
  <p>So with the above string the result should be:</p>
  
  <pre><code>[0] =&gt; 1
  [1] =&gt; 2\|2
  [2] =&gt; 3\\
  [3] =&gt; 4\\\|4
  </code></pre>