Template replacement engine
Regex.Replace with a match evaluator plus a case-insensitive dictionary makes a tidy single-pass template engine — faster and more flexible than chaining string.Replace calls.
5 articles in the notebook
Regex.Replace with a match evaluator plus a case-insensitive dictionary makes a tidy single-pass template engine — faster and more flexible than chaining string.Replace calls.
The famous emailregex.com example is horrible, so I made my own C# email regex — loosely based on it, compiled, and good enough for most use cases.
Windows Phone has no ColorTranslator.FromHtml, so here is a regex-based method that parses #aabbcc, #ffaabbcc and friends into a Color object.
88 projects across 22 solutions needed to become one solution, and Visual Studio crashed trying. So I brushed off my black belt in Perl regex and wrote a script that merges .sln files automatically.
A few one-liners I keep reaching for: filtering and replacing with regex straight from the Perl command line, including in-place file editing with automatic backups.