Remove characters before and after particular subtring in a string in Python
<p>I am new to Python.May be this can be done with regex.I want to search for a particular substring in a string and remove characters before and after that in the string.</p>

<p>Example 1</p>

<pre><code>Input:"This is the consignment no 1234578TP43789"
Output:"This is the consignment no TP"
</code></pre>

<p>Example 2</p>

<pre><code>Input:"Consignment no 1234578TP43789 is on its way on vehicle no 3456MP567890"
Output:"Consignment no TP is on its way on vehicle no MP"
</code></pre>

<p>I have list of the these acronyms(<code>MP</code>,<code>TP</code>) to be searched in the string.</p>