Okay, I'm writing a news system. I'm attempting to add in special tags so that people won't have to use HTML directly (I want to remove HTML). So I'm using a bunch of RegExp's to replace the tags.
Example: Testing
Goal: To get Testing to be displayed in bold.
I tried this first. $story is the variable that contains the news story.
$story = ereg_replace("[b]([([b])])[/b]$", "<b>\1</b>", $story);
That did nothing, so then I tried this.
$story = ereg_replace("[b](.*)[/b]$", "<b>\1</b>", $story);
Once again, nothing. Finally I tried this, even though I didn't think it would work.
$story = ereg_replace("b[/b]$", "<b>\1</b>", $story);
None of these regular expressions have worked. So what's wrong with them?