Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// 1. Setup the Transformer
      Using t As 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
         Dim 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))
      End Using
   End Sub
End Module