Returning the words after the first hypen is found
<p>Suppose I have a list of items - <code>['test_item_A-engine-blade',
'test_item_A-engine-part-initial', 
'test_prop_prep-default-set']</code></p>

<p>and I am trying to grab the words after the first hypen is found such that the result should be as follows:</p>

<ul>
<li>test_item_A-engine-blade => engine_blade</li>
<li>test_item_A-engine-part-initial => engine_part_initial</li>
<li>test_prop_prep-default-set => default_set</li>
</ul>

<p>I tried something like <code>re.sub("[^A-Z\d]", "", &lt;my string&gt;.split('-', 1))</code> but it seems that it only presents me the words before the string...</p>

<p>You can just use <a href="https://docs.python.org/3.5/library/stdtypes.html#str.split"><code>split</code></a> with a maximum number of one.</p>

<pre><code>something.split('-', maxsplit=1)
</code></pre>

python