while your solution didnt exactly fit the bill , thanx a bunch for helping anyway.
for all who may have the same problem I post a solution here:
<?php
$text = "htis is a text and xxxx thisisaword that must become a link ...<br>as well as this xxxx one...";
$text = preg_replace( "/xxxx\ (\b\w+\b)/", "<a href=\"$1.html\">$1</a>", $text );
echo $text;
?>