I have been trying to solve my problem for a few hours now. I must be making a stupid mistake, I guess.....
I want the following text:
Code: Select all
This [b]is[/b] just [b]an example[/b] of a stringCode: Select all
This <b>is</b> just <b>an example</b> of a stringCode: Select all
$string = ereg_replace('\[b\]([[:graph :][:space :]]+)\[/b\]', '<b>\1</b>', $string);But what happens than is that it takes the FIRST match of [ b ] and the LAST match of [ /b ] resulting in:
Code: Select all
This <b>is[/b] just [b]an example</b> of a stringAny help on this matter is highly appreciated!