Ah yes, Movie 2, always loved that one!

Split on '[space] and loop through the resulting array checking for Number or Name would appear to be the obvious solution.