Many helpful details can be found here Using Regular Expressions with .NET – C# and Visual Basic
Matching multiple line?
This is a topic that hard to find one article for it. If you have one, please shared with me!
Replacing that re-uses searched text
Look at this example:
//remove multiple white-spaces System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(@"(\s)\s+"); myString = re.Replace(myString, "$1");
As we can see, we use $1 to retriev the searched text reside in the 1st parentheses. So the rule is to use $# with # is the order number of the parentheses used in the regular expression. Enjoy!