Php正则表达式单词前瞻

I am trying to scrape a webpage for a person's name and am having trouble factoring in the possibility that a middle name may also be present. For example, if i am trying to match the name "John Smith" on a webpage and that page has the name with a middle name included (for example John Mark Smith or John M Smith or John M. Smith or JohnM.Smith), the search will turn up empty even though technically the first and last name are mentioned together on the page.

Is there a regex that can take into account a one word hop in the middle of matching the name? The name is in the variable:

$fullname = "John Smith";

How can i accomplish this?

The question has been slightly expanded to include the possible reverse order.

Try:

(John ?[\w\.]* ?Smith|Smith ?[\w\.]* ?John)

I would try this (or something similar):
replace the space with " ?[a-zA-Z.]* ?"
John ?[a-zA-Z\.]* ?Smith
http://www.phpliveregex.com/p/3jh

preg_match("/(John.*?Smith|Smith.*?John)/", $input_line, $output_array);

See here: http://www.phpliveregex.com/p/3jj