I'm working on a small feature for one of my websites that involves basic BBCode parsing and I'm having difficulty getting it to work 100%.

Basically I'm trying to use Regular Expressions for the matching but certian ones don't seem to always match correctly.

For example, I use the following Regular Expression Pattern for figuring out where the [code][/code] tags are and replace them:
Code:
"\[code\](.+?)\[\/code\]"
I'm not very good with regular expressions so if anyone can tell me why this doesn't always pick up on the code tags correctly or if anyone can recommend an application that can help generate regular expression patterns it would be really helpful!