preg_replace multiple problem

I am trying to replace multiple urls in a pagination element with a new url.

The replacement works fine when there is one occurrence of the url i.e. prev and next, but it breaks on breaks on the Pagination Numbers. It brings the first and last number links together. How do I get the preg_replace function realize that there are multiple occurrences of the links that need replacing?

<?php 
    $pattern = '/\/(.+)\/page:(\d)/S';
    	$replacement = $uurl.'page:$2';
    	echo preg_replace($pattern, $replacement,$paginator->prev('<< '.__('previous', true), array('url' => $paginator->params['pass']), null, array('class'=>'disabled'))).' | ';
    	echo preg_replace($pattern, $replacement,$paginator->numbers());
    	echo preg_replace($pattern, $replacement,$paginator->next(__('next', true).' >>', array('url' => $paginator->params['pass']), null, array('class'=>'disabled'))); 
    ?>