using uCalcSoftware;

var uc = new uCalc();
// 1. Setup the Transformer
using (var t = new uCalc.Transformer()) {
   // Allow patterns to match across multiple lines
   t.DefaultRuleSet.StatementSensitive = false;

   // 2. Define the conversion rules

   // Simple inline tags
   t.FromTo("'['b']'{text}'['/b']'", "**{text}**");
   t.FromTo("'['i']'{text}'['/i']'", "*{text}*");
   t.FromTo("'['u']'{text}'['/u']'", "<u>{text}</u>");

   // URL tag with attribute
   t.FromTo("'['url={href}']'{text}'['/url']'", "[{text}]({href})");

   // Quote block tag
   t.FromTo("'['quote']'{content}'['/quote']'", "> {content}");

   // 3. Define the input BBCode text
   var bbCode = """

Hello, this is a test of the converter.

This text is [b]bold[/b] and this is [i]italic[/i].
You can also [u]underline[/u] text.

Here is a link to the uCalc website: [url=https://www.ucalc.com]uCalc[/url].

[quote]This is a block of quoted text.
It can span multiple lines.[/quote]

""";

   // 4. Run the transformation and print the result
   Console.WriteLine(t.Transform(bbCode));
}