How to delete string with no specific character pattern? : <p>I think what I want to do is a fairly common task but I've found no reference on the web.</p>

<p>I have a list of names, with the following pattern</p>

<p>'first name middle name last name last seen 10 months ago"</p>

<p>I want to keep only the names, to delete all the string starting from the word last, is there a way I can do it?</p>

<p>Example:</p>

<p>output = ' David Smith last seen 8 months ago'</p>

<p>desired_output = 'David Smith'</p>

<p>I thought using regular expression, but I didn't succeed. </p>

<p>Thanks</p>
