Learn, Create, Understand, Test, Use and Save Regular Expressions. The absolute bare minimum every programmer should know about regular expressions (I’m Mike » Blog Archive) How .NET Regular Expressions Work. Remember when you first tried to parse text?
My early BASIC programs were littered with IF statements that dissected strings using LEFT$, RIGHT$, MID$, TRIM$, and UCASE$. It took me hours to write a program that parsed a simple text file. Just trying to support whitespace and mixed casing was enough to drive me crazy. Learning to Use Regular Expressions. Often if you find that your regular expressions are matching too much, a useful procedure is to reformulate the problem in your mind.
Rather than thinking about "what am I trying to match later in the expression? " ask yourself "what do I need to avoid matching in the next part? "