<?php

$rest = "";
$re = '~\b(https?://)www\.myweb\.com/(\S+\b)~'; 
$str = "Some text https://w...content-available-to-author-only...b.com/page/cat/323123442321-rghe432, another http://w...content-available-to-author-only...b.com/page/cat/323123442321-rghe432 and then another https://w...content-available-to-author-only...e.com/fsdhjss/erwr"; 
echo $result = preg_replace_callback($re, function ($m) use (&$rest) {
	$rest = $m[2];
	return $m[1] . "embed.myweb.com/" . $m[2];
}, $str, 1) . PHP_EOL;
echo $rest;