String help

Lets say I have this string:

“Select * from table”

I want to be able to extract the table name that somebody enters.

Unfortunately I will not be able to use any of the static string commands because this user entered string can have unlimited amount of arguments.

Anybody know howto extract that table from this string?

Thanks