How do I use named captures when performing Regex.Replace? I have gotten this far and it does what I want but not in the way I want it:
[TestCase(\"First Sec
Simply replace with ${groupName}
[TestCase("First Second", "Second First")]
public void NumberedReplaceTest(string input, string expected)
{
Regex regex = new Regex("(?First) (?Second)");
Assert.IsTrue(regex.IsMatch(input));
string replace = regex.Replace(input, "${secondMatch} ${firstMatch}");
Assert.AreEqual(expected, replace);
}