Define a pattern and use parentheses to match individual elements within it
<? $test = "Whatever you do, don't panic!"; if ( preg_match( "/(don't)\s+(panic)/", $test, $array ) ) { print "<pre>\n"; print_r( $array ); print "</pre>\n"; } ?>