Store the regexp and replacement patterns in the DB:
regExp: \[image\](.*?)\[/image\]
replacement: <img src="$1"/>
Then later retrieve these from the database and call preg_replace()
with them as arguments. Note that you should be able to do it with a single call, since you can specify the regexp and replacement as arrays, and it will perform all of them at once.