I think there is a communications fault here. Does the phrase "only required fields" in the question mean fields whose content is the string "required" (which would be none); or is the question about how to extract only the first and last, space separated tokens from a string.
Is the $string in the question literal, or simply showing the position of "required fields"?
Clarification please....