Regular Expressions can be an elusive art. Even when you understand all the rules, you still can easily find yourself having to 'hack' at a pattern until you see the results you expect. Here's an awesome regular expressions tool that I've been using for over a year now. Using AJAX, it sends the pattern/subject to the server and and then populates the result boxes seamlessly. It does this as you type so you can very rapidly iterate through a problem.
If you bookmark it you will use it ;)