Issue with split function
<p>I have a list variable <code>name</code>:</p>

<pre><code>name = ['Ny-site-1-145237890-service']
</code></pre>

<p>I want to split this list in a way so I can get <code>name = ['Ny-site-1']</code>.
To do this I am using the below code:</p>

<pre><code>import re
name = ['Ny-site-1-145237890-service']
site_name = re.split('(-[0-9]-service)')[0]
</code></pre>

<p>But the above code is not give me the output I am looking for. How do I get the desired result?</p>