View Single Post
Old 08-04-2008, 03:32 PM   #3 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

This should get you started.

p.s. im not the best at regex so im sure there is a quicker way.

PHP Code:
$string '[bold]this will be turned bold hopefully[/bold]';
echo 
preg_replace('/\[bold\](.*)\[\/bold\]/is''<b>\\1</b>'$string); 
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 08-04-2008 at 03:45 PM. Reason: added s modifier so it matches blocks across new lines
sketchMedia is offline  
Reply With Quote