python - to extract a specific string
<p>I have a string like :  </p>

<pre><code>    string="(tag, index: develop-AB123-2s), (index: develop-CD123-2s)"
</code></pre>

<p>I want to extract only "develop-CD123-2s", i.e. the string that comes after "(index:" and not the one with tag. How do I do in python? Thanks!</p>

<p>You could do it like this:</p>

<pre><code>string = "(tag, index: develop-AB123-2s), (index: develop-CD123-2s)"

string = string.split('(index:')
string = string[1].strip(')')
print(string)
</code></pre>

<p>split the string on <code>(index:</code> and strip off the closing curly bracket</p>

python