Today I managed to find the correct function, so in case someone else wants to do something similar - this is the line that solved my problem $text = preg_replace("/\[(.+?)\]\(wiki:(.+?)\)/e",'MakeLink($pagename,"\\2","\\1")',$text); jem -- Jan Erik Moström, www.mostrom.pp.se