Regex Groups and Find/Replace Tagged Expressions
May 13th, 2009
Every once in awhile I have a need to use regular expressions in code. I love using them in Visual Studio find/replace. And one of my favorite features in the find/replace dialog is tagged expressions. This allows me to make a regular expression match and at the same time extract pieces of it for use in my replace with expression.
So today, I’m toying around with Regex and find a need to have the same behavior in code. The difference is, tagged expressions in code are referred to as matching groups. Normally you would use braces for your tagged expressions in a find/replace dialog; but in code, you would use parentheses instead. Read more…