preg_replace for a word ending with a colon

Braicturirl

New Member
I've tried looking into preg_replace, except that I have not much experience with regular expressions.What I'm trying to do is replace a portion of text ending with a colon and make it bold and put a line break in before and 2 line breaks after.IE convert this text\[code\]title1: is some text here. title2: another piece of text.\[/code\]to\[code\]**title1:**is some text here.**title2:**another piece of text\[/code\]I've tried doing something like this...\[code\]preg_replace("!\*(.*?)\*!$:","\<br \/\>\<strong\>!\*(.*?)\*!\<\/strong\>\<br \/\>",$text);\[/code\]I can't seem to get it to work.Can anyone help?ThanksAndi
 
Back
Top