title: Regex split with split value in results
body: <p>I want to split a string into parts based on a regex (\$\d+\$), but I also want to know what the value of these split-points is. So for example, if have the string:</p>
  
  <pre><code>&lt;option value="beholder" selected="selected"&gt;$33685$&lt;/option&gt;
  &lt;option value="gnuchess_fancy"&gt;$33687$&lt;/option&gt;
  &lt;option value="gnuchess_simple"&gt;$33689$&lt;/option&gt;
   | $29000$
  &lt;option value="beholder"&gt;$33671$&lt;/option&gt;
  &lt;option value="gnuchess_fancy"&gt;$33673$&lt;/option&gt;
  </code></pre>
  
  <p>I want to split it such that the results seperate parts become:</p>
  
  <pre><code>o &lt;option value="beholder" selected="selected"&gt;
  o $33685$
  o &lt;/option&gt;&lt;option value="gnuchess_fancy"&gt;
  o $33687$
  o ......
  </code></pre>
  
  <p>Splitting with the regex \$\d+\$ gives me only the first and third item of the above list, while I want all items. </p>
  
  <p>Programming language does ofcourse not matter, it's about the regex and how to split (or match).</p>
  
  <p>I also tried to match with the following regexs, but no luck</p>
  
  <pre><code>\$\d+\$|.*?
  .*?|\$\d+\$
  .*?\$\d+\$.*?
  (.*?|\$\d+\$)*
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>