I'm struggling with what I imagine is quite a simple regex for a preg_match_all() call. I'm looking to mimic the Wikimedia style internal links system which will turn something like this [[link]] into a link.
I'm looking for a regex that will search a string for any example of [[foobar]] and return "foobar" to me. foobar should really be wild.
I've tried the following:
<?php
$content = "Lorem ipsum dolor [[sit]] amet, consectetur adipiscing [[elit]].";
$links = preg_match_all("[[*]]",$content,$matches);
print_r($matches);
?>
I'm not getting much of anything. Any help would be appreciated.