Regular Expression Splitting
<p>I am new at regex so I am having trouble splitting the following string:</p>

<pre><code>test_str = "./name[contains(substring(.,1,3),'some')],is-in,up,down"
</code></pre>

<p>The string is elimited by commas but if the group contains [], it should not split by comma.</p>

<p>So the result should look like this:</p>

<pre><code>["./name[contains(substring(.,1,3),'some')]", "is-in", "up", "down"]
</code></pre>

<p>I am trying this regular expression:</p>

<pre><code>r"./*[a-z]+((\[.*?\])?)*,?/*"
</code></pre>

<p>...but there is some problem with "-"</p>