working from the inside out
Posted: Tue Aug 05, 2008 3:56 pm
I have the following regex comparison that replaces any [*]content[/*] with <*>content</*>
I was wondering if there's a way to modify this code so it will match when you do multiple tags such as: [*][*]content[/*][/*] so it will convert both sets of [] with <>
Code: Select all
<?php
$pattern = "/\[link\=(.+?)\](.+?)\[\/link\]/is";
$replacement = "<a href=\'$1\'>$2</a>";
?>