public void UnusualDelimiterTest() { var delimitedText = new DelimitedText("^ '('; f", "^ ')'; f", @"^ '\)'; f"); foreach (var(text, _, _) in delimitedText.Enumerable("foo(bar)baz").Where(i => i.status == DelimitedTextStatus.Outside)) { Console.Write(text); } }
public void DestringifyAsSqlTest2() { Pattern.IsFriendly = false; var source = "UPDATE Foobar SET A = -A, B = 'This is a test' /*a test*/;"; var delimitedText = DelimitedText.AsSql(); var parsed = delimitedText.Destringify(source); Console.WriteLine(parsed); Console.WriteLine(delimitedText.Restringify(parsed, RestringifyQuotes.SingleQuote)); var inOutside = new DelimitedText("'", "'", "''"); foreach (var(text, _, _) in inOutside.Enumerable(source)) { Console.WriteLine($"<{text}>"); } }