fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main() {
  7. var rawConnString = "Data Source=<<DATA_SOURCE>>;Initial Catalog=<<INITIAL_CATALOG>>";
  8. var connString = Regex.Replace(
  9. rawConnString
  10. , "(<<DATA_SOURCE>>)|(<<INITIAL_CATALOG>>)"
  11. , m => m.Groups[1].Success ? "datasource" : "catalog"
  12. );
  13. Console.WriteLine(connString);
  14. }
  15. }
Success #stdin #stdout 0.06s 37232KB
stdin
Standard input is empty
stdout
Data Source=datasource;Initial Catalog=catalog