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:
<option value="beholder" selected="selected">$33685$</option>
<option value="gnuchess_fancy">$33687$</option>
<option value="gnuchess_simple">$33689$</option>
| $29000$
<option value="beholder">$33671$</option>
<option value="gnuchess_fancy">$33673$</option>
I want to split it such that the results seperate parts become:
o <option value="beholder" selected="selected">
o $33685$
o </option><option value="gnuchess_fancy">
o $33687$
o ......
Splitting with the regex \$\d+\$ gives me only the first and third item of the above list, while I want all items.
Programming language does ofcourse not matter, it's about the regex and how to split (or match).
I also tried to match with the following regexs, but no luck
\$\d+\$|.*?
.*?|\$\d+\$
.*?\$\d+\$.*?
(.*?|\$\d+\$)*
Any help is greatly appreciated.