Regex, filter url ending with and without digit
<p>I have below four url out of which I want to filter only two using regex expression. </p>

<p>/chassis/motherboard/cpu      &lt;---- this</p>

<p>/chassis/motherboard/cpu/core0</p>

<p>/chassis/motherboard/cpu0     &lt;---- this</p>

<p>/chassis/motherboard/cpu1/core0</p>

<p>I have tried to play around with ^.*[0-9a-z_].cpu but unable to get the solution.</p>

<p>You can use this regex:</p>

<pre><code>^.*/cpu[0-9]*$
</code></pre>

<p>This will match any text that ends with <code>/cpu</code> or <code>/cpy&lt;number&gt;</code></p>

python regex url filter uri