Check if table name is invalid without using regular expression