попробуйте так PHP: <?php $str = 'John Ken&chelsea Mary'; preg_match ('/(\b\w+&\w+\b)/', $str, $matches); print_r ($matches); ?>