Visual Studio Regular Expressions
Replacement patterns To use a numbered capture group, surround the group with parentheses in the regular expression pattern. Use $number, where number is an integer starting at 1, to specify a specific, numbered group in a replacement pattern. For example, the grouped regular expression (\d)([a-z]) defines two groups: the first group contains a single decimal digit, and the second group contains a single character between a and z. The expression finds four matches in the following string: 1a 2b 3c 4d. The replacement string z$1 references the first group only, and converts the string to z1 z2 z3 z4. ...