To convert the line breaks in a C# string from <br>, <br />, and <br/> to \n using regex, you can use the following code:

using System;
using System.Text.RegularExpressions;

class Program
{
    static void Main()
    {
        string input = "This is a <br>sample <br  />text with<br/>line breaks.";
        
        // Replace <br>, <br  />, and <br/> with \n
        string output = Regex.Replace(input, @"<br\s*/?>", "\n");
        
        Console.WriteLine(output);
    }
}

This code uses the Regex.Replace method to find occurrences of <br>, <br />, and <br/> in the input string and replaces them with \n. The resulting string is then printed to the console

c# br br br to n use regex