I'm created a bb system and I want the board owner to be able to specify custom bbcode, such as:

Code: @
Replacement: <a href=\\1>\\1</a>

so I have to be able to parse their input into preg strings.

Here is an example of what I have so far:
Example: http://www.vbshelf.com/bb/test.php
Code: http://www.vbshelf.com/bb/test.phps

However, it doesn't quite work. Does anybody have any ideas why?