Breaking It Down: Regular Expressions for Regular Programmers
mobilitea.com
mobilitea.com
I personally use Emacs' regex-builder mode to get quick visual feedback on what a pattern matches on a given input data before I set it loose. (regex-coach is Perl compatible but emacs is not; I frequently type [0-9]+ in emacs to mean \d+)
Far better than cludges and crutches is a good RegEx tester, for example: http://www.regextester.com/
Put in the real deal. Put in what you expect to match, and tweak until you get it right and understand why it wasn't working before.
For example, I found code that generates expressions like "(^|)Terminal(|)" in running mono code in a project I'm working on. I have played with REs a fair amount and I don't know exactly what this should do or why. But it's been doing it for a while.
Sorry, but most Regexing should be avoided unless you have a really good reason. Use system calls to parse file paths, use a really parser to parse a DSL, and so-forth.