I would suggest this:
$var = "Here is some text with links [[Link One|http://www.link1.com]] and more \n\n\nlinks [[Link Two|http://www.link2.com]] and beyond that there is not much to say\n";
$var = preg_replace('#\[\[([^|]+)\|([^]]+)\]\]#', '<a href="$2">$1</a>', $var);
Just to add a note on using .* - this is a very highly inefficient way of doing things...
As an extremely simplified example (from another post of mine):
Say your string is: "I'm Gerry, hi!"
And suppose you are using this pattern: #(.*)gerry#i
What happens is regex sees .* and greedily captures everything up to the end.. so at this point, the capture is equal to the whole string (I'm Gerry, hi!). Along the way, the engine is inserting saved states (position markers between each character) as it captures each character greedily.
However, since there is more after the (.) in the pattern (in this case, the letters g,e,r,r and y), the engine attempts to satisfy the rest of the pattern. So is starts to backtrack.. it relinquishes the last saved state character from the capture (which points to the ! character) and checks to see if this character is the same as the first character that follows (.) in the pattern [in this case, the g in gerry]. Nope.. now the engine must go backtrack and relinquish yet another saved state character from the capture and see if that character (i) matches g. Nope. So on and on the engine backtracks in reverse order and checks to see if the newest backtracked character matches.. only when the engine reaches g, does things start to move forward again..thus Gerry (case insensitive due to the I modifier) indeed follows after (.) So we are left with (I'm ) as the capture...this is alot of work to capture what comes before Gerry in the string.. While this example is a small one, it gets worse when you use . or .+ to find something in the middle of much larger chunks of data.
So in my case in the ULR replacement, I made use of negated character classes instead. Example: ([|]+) // capture anything that is not a pipe character, one or more times.. this doesn't require backtracking, thus saves the regex engine some work and as a result is faster. While I realize there are some newlines in the middle of the string (and as a result, (.*) wouldn't capture all the way to the end of the complete string), it still requires some backtracking...
Just something to consider.